Here, the error will shows in this line 'circle = map.drawCircle({ ......
Eror:Uncaught TypeError: map.drawCircle is not a function,
How do I get past the solution for this?help me to solve this
- <script type="text/javascript">
- var poi_coordinates = [[32.27, 77.19],[32.25, 77.22] , [32.23, 77.21], [32.24, 77.17],[26.61,77.19]]
- var lattitude = 32.25;
- var longitude = 77.19;
-
- var latlng = new google.maps.LatLng(21.16536,72.79387);
- var myOptions = {
- zoom: 5,
- center: latlng,
- mapTypeId: google.maps.MapTypeId.ROADMAP
- };
- map = new google.maps.Map(document.getElementById('map'), myOptions);
-
- circle = map.drawCircle({
- lat: lattitude,
- lng: longitude,
- strokeColor: '#fff',
- strokeOpacity: 1,
- strokeWeight: 3,
- fillColor: 'rgba(75,255,0,0.2)',
- fillOpacity: 0.4,
- radius: 4000,
- editable: true,
- });
-
- map.addMarker({
- lat: lattitude,
- lng: longitude,
- draggable: true,
- fences: [circle],
- outside: function (marker, fence) {
- alert('This marker has been moved outside of its fence');
- }
- });
-
- for (var a = 0; a < poi_coordinates.length; a++) {
- if (map.checkGeofence(poi_coordinates[a][0], poi_coordinates[a][1], circle)) {
-
-
- map.addMarker({
- lat: poi_coordinates[a][0],
- lng: poi_coordinates[a][1],
- draggable: true,
- fences: [circle],
- outside: function (marker, fence) {
- alert('This marker has been moved outside of its fence');
- }
- });
- }
- else {
- alert(poi_coordinates[a][0] + "," + poi_coordinates[a][1] + ' is out of the 4 Km fence')
- }
- }
- </script>