Open craigappl opened 5 years ago
@craigappl Do you have an idea of how points should look like when selected and how they'll probably look before they are selected?
Style Approach
The following are ways on how to achieve all these:
These two enable us to define most of the styling from a server(Mapbox studio or wherever this style will be living) and does not require a new release to make such changes - It's configurable easily and by default.
Programmatically
This approach will use a Builder pattern
@githengi @manutarus Do you have any input/ideas on this?
@craigappl Do you have an idea of how points should look like when selected and how they'll probably look before they are selected?
@rowo , do you have any thoughts on this? The UI mock-ups show the color orange. I think we should have a visual indicator. In Google maps, they show the icon much larger than all of the other icons on the map to signify that is the one that's selected.
@ukanga is there a precedent we can use from mSpray?
@ekigamba the first option if possible will be the best option. If its not possible we can use Programmatic approach
Cool, I'll look into how that is possible within the style via approach no. 1 depending on the results of https://github.com/onaio/kujaku/issues/158.
@craigappl I had created a special more prominent visual indicator but I think Matt or Derek nixed that and said that they appeared orange in mSpray or OMK or whatever. That's for structures. For points, we could still use it since it doesn't have a specified shape — but i wonder if that would get confusing with people thinking there's a hot air balloon shaped structure somewhere.
@ekigamba and @rowo , points seem to show up as circles right now, not balloons. Let's keep it as it is and just change the color following what's in mSpray.
@githengi @craigappl We'll go with this option as @githengi requested
We can also have a select layer where we just add the selected feature to the select layer - Kujaku can move the selected feature to the select layer.
The only difference being that this will have to be done in the host application since this is not an API thing.
I have updated the current reveal style to have a select layer with the id select-layer
and fill color for the polygons as orange
.
Due to the nature of the select feature currently, I think it is better if it's handled by the host application(Reveal) until when we can establish a clearer and more acceptable API that can be added to the widget. If it were to be added to the widget it would need a lot more work to make it configurable with other conventional strategies for such a feature. I wrote sample code to show how this can be achieved here https://github.com/onaio/kujaku/pull/204 since it requires a few lines of code
Is this ok with everyone?
When a user touches the map, the point and possibly icon should change. The GeoWidget needs to support defining an "on tapped" style. This needs to support multiple geometry types (Point, Polygon)
For example a tapped point in Reveal highlights the GeoJSON polygon as orange: