New answers tagged

0

The map.getScale() method returns the X value in 1:X, where 1 and X have the same unit. When you see a map scale of 144447.638, that's 1 map inch = 144447.638 real world inches (or 1 map meter = 144447.638 real world meters). If you want to convert the unit of the second measurement to miles, just convert the map.getScale() value from inches to miles. ...


2

As an alternative to @Joran's approach, you can skip GeoJSON completely and just iterate through the points, creating instances of L.LatLng and L.Marker as you go, like: var points = [{ "latitud": 43.526523590087891, "longitud": -5.6150951385498047 }, { "latitud": 43.511680603027344, "longitud": -5.6671133041381836 }, ...


3

You have a JSON but Leaflet really likes geoJSONs, so you should convert the JSON to geoJSON first, or directly load a geoJSON. So for your example, if you have: var data =[{ "latitud": 43.526523590087891, "longitud": -5.6150951385498047 }, { "latitud": 43.511680603027344, "longitud": -5.6671133041381836 }, . //More Lat-Lng Points . { "latitud": 43....



Top 50 recent answers are included