tillnagel / unfolding

A library to create interactive maps and geovisualizations in Processing and Java
http://unfoldingmaps.org
Other
477 stars 245 forks source link

How to style markers with geoJSON and CSV #166

Closed SebastianHaiduk closed 5 years ago

SebastianHaiduk commented 5 years ago

Hi Guys,

so I am working on project, and I am using Unfolding. I am trying to add markers from a geoJSON file on the map. This is working fine. But now i want style those markers based on values from an csv datasheet. I have no idea how or if this is possible.

I only used this command:

List countries = GeoJSONReader.loadData(this, "stationen.geojson"); List countryMarkers = MapUtils.createSimpleMarkers(countries); map.addMarkers(countryMarkers); Maybe some can help me, thank you in advance

Sebastian

tillnagel commented 5 years ago

You can simply iterate over all created markers and style them, e.g.

for (Marker marker : countryMarkers) {
    marker.setStrokeColor(color(255, 0, 0));
}

For more customiaztion, check out this example showing how to load GeoRSS data and use your own custom markers, which you can draw in any way.

Hope this is still useful for you.