maptalks / maptalks/maptalks.js

Conditional Symbol markerFile

Open
#1,843 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
HTML
Stars
4.5k
Forks
511
Avg merge
3d 58m
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CodePen reproduction for issue #1843 and inspect how conditional symbols are assigned to the GeoJSON features. Verify the behavior using maptalks 1.0.0-rc.14 in Firefox. Done means each feature displays only its own conditional symbol, without symbols from earlier features overlapping it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.