New answers tagged

0

I just got a basic Leaflet webpage setup and working after hacking away at it for a long time before finally giving up and asking for help on StackOverflow (the Leaflet.com quickstart tutorials do not have working code, or I may have missed something there where it talks about the #map properties inside style tags). Check out this stackoverflow question for ...


0

you can create a FeatureLayer via a FeatureCollection, which is essentially just all your data, with a schema defined. You pass your FeatureCollection instead of the FeatureLayer URL: var featureLayer = new FeatureLayer(featureCollection, { showLabels: true }); Helpful links: FeatureLayer Constructor from FeatureCollection FeatureSet Feature Layer ...


0

It is possible to convert to shapefile in JavaScript, in the client side. The following library accomplishes this. Perhaps it is outdated (2012-2013), but at least it shows the concept. JS2Shapefile JS2Shapefile is a Javascript class to create ESRI shapefiles directly in the browser. It also includes a couple of helper classes for creating and ...


0

Found the answer. This is an example of 3 paths in JSON:


0

You could look at: var jsonSerializer = new NetTopologySuite.IO.GeoJsonSerializer(); jsonSerializer.Deserialize(...)


0

Read the JSON standard and GeoJSON standard - they specify everything from commas to brackets to property fields in the geographical data.


0

L.layerJSON does not exist! Read http://leafletjs.com/reference-1.0.0.html !! You probably want to create new instances of L.Marker by looping through the data received via websockets, and then doing something like L.marker([msg.latitude, msg.longitude]).addTo(markers) to add the new markers to your instance of MarkerClusterGroup.


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 }, ...



Top 50 recent answers are included