У меня есть набор маркеров, добавляемых на карту с уровнем увеличения 15. Маркеры lat и lng в настоящее время устанавливаются с шестым десятичным знаком.
Когда я увеличиваю или уменьшаю масштаб, местоположения маркеров перемещаютсяиз своего правильного положения.Нужно ли удалять и перерисовывать маркеры на каждом уровне масштабирования?мне нужно повысить точность моих координат?это сводит меня с ума ...
Тестовая страница: http://m.uwosh.edu/api/v1.0/map/ нажмите на желтый значок в нижней панели.
Я создаю свои маркеры следующим образом:
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',
// This marker is 20 pixels wide by 32 pixels tall.
new google.maps.Size(24, 28),
// The origin for this image is 0,0.
new google.maps.Point(0,0),
// The anchor for this image is the base of the flagpole at 0,32.
new google.maps.Point(0, 28));
shadow = new google.maps.MarkerImage('/api/v1.0/map/images/shadow-buildings.png',
// The shadow image is larger in the horizontal dimension
// while the position and offset are the same as for the main image.
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);
// could add event handler here
//add marker to array for latter use
if (type === 'building') {
buildingMarkers.push(marker);
}
}