Nianwei,
Just been looking at that polyline mouseover highlight function again. I'm
just wondering how I can set a tolerance on it, i.e. hover mouse within a
certain distance and the polyline/point highlights. At the moment I've got:
function getLineCenter(line) {
var path, latlng;
var lat = 0;
var lng = 0;
var c = 0;
path = line.getPath();
for (var k = 0, kc = path.getLength(); k < kc; k++) {
latlng = path.getAt(k);
lat += latlng.lat();
lng += latlng.lng();
c++;
}
if (c > 0) {
return new google.maps.LatLng(lat / c, lng / c);
}
return null;
}
Can I just add in a +/- tolerance on the latlng variable?? Got any ideas?
Thanks for any assistance.
Ed
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-maps-js-api-v3/-/YzFNMmFJdWt1TXNK.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.