developmentseed / observe

Cross-platform, offline, field mapping tool for OpenStreetMap
ISC License
66 stars 5 forks source link

Use different styles for member nodes vs snapped nodes #271

Closed geohacker closed 4 years ago

geohacker commented 4 years ago

Currently we have identical styles for member nodes and new nodes that we are adding + snapping to.

Screenshot 2020-05-28 21 20 55

We should have different styles so users can easily snap to existing nodes.

cc @LanesGood

LanesGood commented 4 years ago

@geohacker. we currently have just one style for NearestNode and a separate style for EditingNodes. When hovering over an existing way, only the NearestNode style is used. I do see the id Observe when logging the NearestFeatures feature collection, so I assume something like the below should be possible. These two approaches aren't working - any suggestions?

const nearestNodes = {
  circleColor: { id === observe ? colors.primary : 'white'},
  ...
}
circleColor: [
    'match',
    ['get', 'id'],
    'observe/*', colors.primary,
    'white'
  ],
...

cc @sethvincent

geohacker commented 4 years ago

@LanesGood yes, though Mapbox GL doesn't support those wildcard matching. So I just added a new property called membership: no to distinguish these new nodes. Pushed to the PR and I think it's ready. Thank you!

LanesGood commented 4 years ago

Closed by #272