Tag Info

New answers tagged


You can change your style function to accept another parameter, and use that to set your style. When the user wants to change the rendering, you just call .setStyle(feature, color). You will also need to create a function to define the colors for that dataset as well. For example, I'm using a function name of getGenderColor(). Example: function ...


I have looked into this before...and although I do not know how to export JSON in the exact web map spec that you referenced, you can come close using the Item Data operation of the REST API which can exports Web Map data. This might have the information that you require (or not). As I mentioned, the JSON object returned using this operation is not the ...


To parse or deserialize geojson in Java REST webservice, i prefere to use geojson-jackson , which integrates very nicely with jackson.


This is not directly available through the API. The PrintTask can be used to get the Web_Map_as_JSON. map.on("load", function(){ require(["esri/tasks/PrintTask", "dojo/_base/json"], function(PrintTask, JSON){ var printTask = new PrintTask(); var Web_Map_as_JSON = JSON.toJson(printTask._getPrintDefinition(map)); }); });


Geotools as a support for geojson. See here. Otherwise, you could simply use a typical JSON parser (such as json-simple) together with the geoJSON spec, which is really easy to use. The best solution depends on what you want to do with the parsed information.


The reason you are getting a "not well formed" error in console is because your tilejson file loads asynchronously, meaning the script continues to execute while the tilejson object is only partly loaded as an incomplete promise object. So when you pass your tilejson object to L.mapbox.map, you are actually passing a promise object (which it can't parse). ...


Last time I tried to pass tileJSON directly to the L.mapbox.map constructor, I ran into issues when mapbox.js tried to automatically load retina tiles from my non-mapbox tileserver. If you are using a retina device, could point to your problem. If not, might cause additional problems after you've fixed your current issue. Check your console to see if you ...


I would use getJSON() from the jquery library: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> var tilejson; $.getJSON('/path/to/your.json', function(data) { tilejson = data; });


I have already resolved this. heres my answer: HTML: OpenLayers 3 - LayerSwitcher <style> html, body { height: 100%; padding: 0; margin: 0; font-family: sans-serif; font-size: small; } #map { width: 100%; height: 100%; } .popup { ...

Top 50 recent answers are included