Hi to all, I am using Openstreetmap with leaflet. 1.In zoom level 1, There is some empty space in bottom & top, but horizontally map tiles are repeated. But my markers shown in a single map.(refer image1.png). Is there any option to show markers in all maps shown, or How to load or show a single map? 2.In other zoom levels, i want to disable drag when reach bottom or top of the map. Because after reach bottom or top, it will show empty spaces only(refer image2.png) Note: In google maps it is working fine(cant drag when reach top/bottom). asked 29 Jul '15, 08:04 Rajavelu_M |
I've used these settings (coords changed to yours):
answered 15 Aug '15, 10:22 Protect OSM Hi, Still its not working to me. Can you give in fiddle, or full source(with html).
(16 Aug '15, 07:27)
Rajavelu_M
Sorry for my late answer. Here's a demo:
(24 Aug '15, 11:43)
Protect OSM
@Protect OSM: I think you are mis-understand my question, Actually i need to disable drag when my drag reach bottom/top of the map. Currently i can drag when reach top/bottom of map, but it shows empty page.
(24 Aug '15, 11:50)
Rajavelu_M
If I "overdrag" the map it shows eveything perfectly but on "drop" it bounces back fitting the original bounds. (http://i.imgur.com/x41dtJg.jpg - cursor was over the "Leaflet" copyright in the bottom, right.) If it's not working at you like this, there's something wrong. Could you please give a link to your site?
(24 Aug '15, 12:03)
Protect OSM
|
I found answer for how to disable drag?
map.dragging.disable();
But, still i dont know, how to find the map reached the top or bottom?
Also tried as map.setMaxBounds([[51.490, -0.122], [51.510, -0.028]]); for disable drag when reach top/bottom. But not working(map cant drag horizontally)