Quantcast
Channel: Question and Answer » leaflet
Viewing all articles
Browse latest Browse all 198

loading geojson in leaflet

$
0
0

I just added the geoJSON vector layer in leaflet for my hybrid mobile app using phonegap, the problem is that when I add the geoJSON file of size larger than 2mb the application crashes.
What is the problem does larger geoJSON files can not be loaded this way?
The code for loading geoJSON file in my map window is below.

var roadStyle = {
     color: "#00ff00",
     weight: 3  
};

var roads = [geojson]; // geojson data is added in roads variable

L.geoJson(roads, {
 style: roadStyle
}).addTo(map);

Thanks in advance.


Viewing all articles
Browse latest Browse all 198