-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Maps] Custom icons point styling #30738
Comments
Pinging @elastic/kibana-gis |
Looking at the mapbox-gl API and style spec (https://docs.mapbox.com/mapbox-gl-js/style-spec/): The individual properties of SVG icons cannot be styled dynamically, based on data-driven properties with the same primitives as regular circle markers. The maps app as of 6.7/7.0 will use border-width/color to style the border of a circle marker, and fill-color for the color itself. This will be difficult to translate as-is to any arbitrary SVG icon. With basic usage of the mapbox-API, icon-size can be data-driven, but border-color, fill-color, and border-width cannot. For the maps app, we could consider a work-around, and generate icons for all the possible outline-width and outline/fill-color combinations. That would introduce quite some complexity. We could limit scope somewhat:
The above limitations seem fairly reasonable imho, and would be inline with the majority of GIS toolkits. |
Thanks for digging in @thomasneirynck! This is great, I think we definitely have a path forward here. Some quick comments.
Bummer, but hey - it was worth looking into
I agree, this is crazy for a custom icon. It would be nice to provide out of the box fill colors for pre-packaged Maki icons though. I could imagine a similar experience to the one I described here for Canvas elements (#34393). But instead of elements, they would just be the maki icons with a handful of our brands colors. So it's not a completely custom approach, but there are enough icons and color options to differentiate data points on a map.
I think this would be more than enough for the majority of use cases. Static styling is fine, dynamic sizing would be great to have if possible. I would think SVG's lend themselves to being dynamically sized pretty easily.
I think we can approach user provided SVG's in two ways. The first, we push for a bit and wait to figure it out. The second, we simply only allow the upload of the SVG without customization. If you're uploading an SVG, you can color it beforehand. Static only. But you can still dynamically size. |
Will custom icons support an orientation property? Often it's useful to indicate direction of travel. |
Update from our discussion this week:
|
@gose @alexfrancoeur agreed that orientation should be supported |
@thomasneirynck thoughts on adding a custom CSS input box (similar to Canvas) so users can customize even further if they'd like? |
Reopening: this asks for user-provided icons, not ability to add icons from a fixed set |
I would really appreciate to be able to use custom SVG (even with limitations on styling). For my use case, the important feature would be to offer to choose the symbol based on a field value. I opened a ticket for this #60781 More advanced styling would be bonus to me. Altough, I can see use case for your option b "preserve dynamic styling of icon size (so size can be driven by ordinal values. aka. bigger values = bigger icons). mapbox will handle the rescaling of size based on style-rules." |
thx @glazou for following up on this issue (and #60781 earlier). In general, the earlier discussion in this ticket has grown a little out-of-date: The situation as of 7.6:
We reopened this ticket because a core-ask, the ability for a user to provide an ad-hoc icon is still open. Will post here if there's any updates on the topic from the maintainer-side. |
Thanks Thomas, it's much appreciated |
I'd also love to have this. I have several different companies I'd like to put on a map and if I could import their logos, the map would be way more intuitive. |
I stumbled upon this issue looking for the same type of feature. I would be happy if there were "network" type of icons to use on the map layer. Switches, hubs, VPN Concentrator, Satellite, etc. |
thx @3dog for the feedback, I created an ER for your specific request here: elastic/maki#11 |
I also went looking for this feature. Elasticsearch maps is amazing, but it does limit the utility not being able to change the icons. For example, I have to display a bunch of global conflict data and need an icon for battle. I'm just going with "blood bank" 😂 |
other user comment from @hbs128, #80651
|
Just want to join the chorus and say I too agree the ability to upload SVGs would seem to be the best option here. Effective communication of the message of the dashboard data is the primary KPI that determines if the audience will see the value delivered. |
Multiple customers asking for this from GeoCAB (feedback group). |
Any movement on this issue/request? |
We are currently exploring options for supporting custom icons in #113144. But we're still very early in the process so we don't know now when the feature will be released.
@seanbirdsell does your use case require dynamically styling the icons (color, orientation, etc) based on attributes? Would you be using SVG icons, PNG icons, or both? |
Thank you for the clarification. On your question regarding dynamic styling: yes. Given that, I'd think SVGs are the way to go, no? |
Yes, SVGs will also be easier to scale and style in the legend. So I think supporting SVG icons is the goal. If necessary, we can examine PNG icon support in the future. |
This is awesome, thank you @nickpeihl 🙏 |
When we demoed the prototype of the maps app, we had a feature that allowed you to select from a group of icons.
I think this is a valid use case but an even more powerful feature would be the ability to upload your own image, similar to Canvas. If we only allowed for an SVG upload, I think the load on the app would be pretty small. This image could be persisted with the map JSON object itself if we wanted.
This is an example from @eskibars blog and done in Vega and it's a very valid use case. You can imagine an SVG of a plane for flight tracking, cell tower for telecom coverage, etc.
The text was updated successfully, but these errors were encountered: