I have a set of markers added to the map at zoom level 15. The lat and lng markers are currently set to the 6th decimal position.
When I increase or decrease the location of the marker, they get out of their correct position. Do I need to delete and redraw markers at each zoom level? Do I need to improve the accuracy of my coordinates? it drives me crazy...
Testing page: http://m.uwosh.edu/api/v1.0/map/
click the yellow icon in the bottom panel.
I create my markers like this:
function createMarker(data, type)
{
var posn = new google.maps.LatLng(data.lat,data.lng);
var title = data.title;
var image,shadow,shape;
if (data.typeId === '101') {
image = new google.maps.MarkerImage('/api/v1.0/map/images/buildings.png',
new google.maps.Size(24, 28),
new google.maps.Point(0,0),
new google.maps.Point(0, 28));
shadow = new google.maps.MarkerImage('/api/v1.0/map/images/shadow-buildings.png',
new google.maps.Size(39, 28),
new google.maps.Point(0,0),
new google.maps.Point(0, 28));
}
var markerOptions = {
position: posn,
title: title,
shadow: shadow,
icon: image
};
var marker = new google.maps.Marker(markerOptions);
if (type === 'building') {
buildingMarkers.push(marker);
}
}
source
share