Sorry to bring this up, but I'm having this zoom issue when I use the Google map tiles. I was just wondering if anyone else has, and If they've found a way to fix the issue. I'm trying to use custom icons with leaflet and the Google Map tiles, but every time i zoom the markers move before the map.
i'm creating a custom icon
var rsIcon = L.Icon.extend({
options:{
shadowUrl: "<%= asset_path('search/marker...@2x.png') %>",
iconSize: [22,36],
shadowSize: [22,36],
iconAnchor: [22, 36], // point of the icon which will correspond to marker's location
shadowAnchor: [4, 42],
popupAnchor: [-3, -76]
}
})
I'm creating the Map:
map = L.map('map-display', {drawControl: true}).setView([lat, lng], 12);
googleLayer = new L.Google('ROADMAP');
map.addLayer(googleLayer);
I'm creating my markers and putting them in a LayerGroup:
marker = new MyCustomMarker([property.lat,property.lng],{icon: defaultMarker,title:property.property_id});
marker.bindPopup(markerTemplate(property),{showOnMouseOver: true})
var addToMap = function(layers){
if (map.hasLayer(propertyGroup)){
removeMarkers()
} propertyGroup = new L.LayerGroup(layers)
propertyGroup.addTo(map)
}
This gives me leaflet with google tiles, and custom icons for my map. Every time i zoom the markers move, then the map moves.
I'd really appreciate a point in the right direction.
Thanks,
John