TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
karthika pommudu
NA
321
35k
Uncaught TypeError: map.drawCircle is not a function
Mar 19 2019 6:05 AM
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;
//28.6339;
var
longitude = 77.19;
//77.2200;
//creating map
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);
//creating geofence
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
,
});
//Plotting Main Coordinates
map.addMarker({
lat: lattitude,
lng: longitude,
draggable:
true
,
fences: [circle],
outside:
function
(marker, fence) {
alert(
'This marker has been moved outside of its fence'
);
}
});
//Plotting extra coordinates
for
(
var
a = 0; a < poi_coordinates.length; a++) {
if
(map.checkGeofence(poi_coordinates[a][0], poi_coordinates[a][1], circle)) {
//Code work properly as it should if I add this alert line
//alert(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>
Reply
Answers (
1
)
how to get xml parse value in loop..
disable click event