Read GeoJSON style from file as default
See original GitHub issueWe have a template (geojson_style.js) for styling the GeoJSON object.
function {{ style }}(feature) {
return {
{%- if quantize_fill %}
fillColor: {{ quantize_fill }},
{%- else %}
fillColor: '{{ fill_color }}',
{%- endif %}
weight: {{ line_weight }},
opacity: {{ line_opacity }},
color: '{{ line_color }}',
fillOpacity: {{ fill_opacity }}
};
}
The template is filled here and that usually happens with the default values. But if the GeoJSON file has properties
defined a simple function style_1(feature) {return feature.properties;}
would suffice and, in same cases, that is the expected behavior.
I would like to discuss here the possibility of making “reading from properties” the default behavior instead of the default values we have and leave the kwargs
as an override option.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
GeoJSON Styling information - GIS Stack Exchange
For GeoJSON - CSS styles are used to modify your points, line, ... OPTIONAL: default "555555" // the color of a line as...
Read more >Is it possible to extract style information from GeoJson for an ...
I am able to create a vector layer from this geojson in an openlayers map, but unable to utilize the styling properties.
Read more >Load data from an external GeoJSON file | Mapbox GL JS
This example adds GeoJSON data from an external file and uses it in a layer on the map. ... setFog({}); // Set the...
Read more >Using GeoJSON with Leaflet
The GeoJSON layer GeoJSON objects are added to the map through a GeoJSON layer. To create it and add it to a map,...
Read more >An Update to Working with GeoJSON in the Browser | HERE
Reader('/path/to/geojson/file.json'); reader.parse(); map. ... One possible issue with this code block is that uses the default the marker ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I plan to work on this soon, unless someone beats me to it.
Any news on this issue?