Hello users,
I am busy with leaflet map. I have still unanswered problem and i checked many examples, but no one is clear enough how it works. There is no good example found how it works.
Here is my problem:
I build a map site, with this code:
var mapAttrib = 'Map data 2016 ©';
var mapUrl = 'images/map/{z}/{x}/{y}.png';
var map = new L.TileLayer(
mapUrl, {
attribution: mapAttrib,
tms: true,
continuousWorld: true,
maxZoom: 7,
minZoom: 3
}
);
map.addLayer(map);
map.setView(new L.LatLng(-39.3683,-67.5), 3);
It works and i have added many markers ... in latlng coords. Not in pixels coords!
Now, after a while, i found better map image. I want use new map image in my site, but there is problem: the tiles have slight different zoom (+1 diff) and also not exact same area. That causes the new map is not lined up (or calibrated) to old markers. Everything is now out of position, more moved to wrong position.
Thus, to fix the problem, i have seen methods:
- unproject code
- crs: L.CRS.Simple
- setMaxBounds
- custom projection with
http://jdduarte.com/stories/2013/06/06/leaflet-js-with-custom-projection/I need only zoom fix and align the new map to old map, so markers will back on correct spots on map with new map image.
What is easy and best method to fix the problem.
It can moved with new latlng 0,0 position or pixels position. Remember my markers are in latlng coords stored.
I need a code example to fix the problem. Then i can understand it which code is needed for my problem.
Thank you very much.