Conditional Symbol markerFile
maptalks's version and what browser you use?
Maptalks version: 1.0.0-rc.14 Browser: Firefox, 106.0.5
Issue description
I have a geojson file with several features in. I want to use different symbols for representing each of the features, conditional on values of the feature (such as latitude, longitude and other properties).
I would expect to be able to use a standard if, else function to assign a symbol to each feature (as shown in the reproduction URL).
However, doing this leads the symbols to overlap on each other. Specifically:
- the first feature in the collection is shown with the correct symbol correctly
- the second feature is shown with the correct symbol and the symbol of the first feature.
- so on...
Please provide a reproduction URL (on any jsfiddle like site)
https://codepen.io/jokroese/pen/NWzwPeV
Note how the symbol for Berlin (the second feature of the collection) has both the (correct) Berlin symbol and the (incorrect) London symbol.
I made a simple example, https://codepen.io/deyihu/pen/jOKaqJB?editors=0010 Because I don't fully understand your needs, I'm not sure if it's what you want @joekroese
Hi @deyihu! I'll try to be clearer with what I'm trying to do :)
What I am trying to do is:
- have the symbol of the eye be the only symbol for London (the western coordinates in the example) and
- the tower be the only symbol for Berlin (the eastern coordinates in the example)
The problem is that, instead of just showing the tower in Berlin, it shows both the eye and the tower.
In other words:
I have a single GeoJSON file with type FeatureCollection. How can I represent the features with multiple different symbols?