1
votes

Hello I have the problem that i use leaflet and I dont boundbox the map. Now if an user is drag the map and going out of the normal -180 to 180 lng or -90 to 90 lat my markers dont shown at the new location.

The marker will requested from an api I have written. Where I use the boundbox coordinates. The problem now is, that I send something like:

lat_min:-23.563987128451217
lat_max:70.61261423801925
lon_min:-343.828125
lon_max:136.40625

to my script and I don't know how i can normalize the coordinates correct to pass the degrees.

EDIT 24.10.2016 01:33 UTC

My MySQL use between:

geolat: {
  $between: [lat_min, lat_max]
},
geolon: {
  $between: [lon_min, lon_max]
},

Thank you for your hints and tips.

1
Have you tried map worldCopyJump option? - ghybs
Hello @ghybs thank you for this hint, but this works only if i drag over 50% of the mal to one side. But i looking for a function that works like on google where the marker jump to the side thats new when the marker out of the view. - Jomaar
Unfortunately this is a known limitation of Leaflet. See Leaflet issues #2506 and #4919 - ghybs

1 Answers

0
votes

Dude leaflet itself provides wrapLatLng which can be used as map.wrapLatLng(latLngPoint), this returns normalized form of latitude longitude how we need.