mapbox / mapboxgl-powerbi

Mapbox Visual for Power BI - High performance, custom map visuals for Power BI dashboards. This version of Mapbox Visual for Microsoft Power BI is no longer maintained. You can find the live and maintained version of the plugin at: https://github.com/starschema/mapboxgl-powerbi.
MIT License
127 stars 52 forks source link

Add symbol layer type #87

Closed ryanbaumann closed 1 year ago

ryanbaumann commented 6 years ago

Proposal

Developers want to be able to create icons to drop into their map visualization, in addition to circles, for point type data. This issue tracks adding symbol layer support to the Mapbox Visual for Power BI.

Design

  1. Symbol layer should be a new layer type option in the Mapbox Visual for Power BI format panel.
  2. Symbol layer should contain the same viz class base layers as all other visualizations (visibility, opacity, minzoom, and maxzoom.)
  3. Symbol layer should allow users to select from a list of curated icons to use in their map.
  4. Symbol layer should allow users to add a PNG from a reference a URL to use as a custom icon. The URL should return an image in PNG or SVG format.
  5. Symbol layer should allow users to enable/disable collision detection between symbols when they overlap while zooming.
  6. Symbol layer should allow users to adjust the size and color of the icon based on data values, just like circles.
pedro-rtm commented 6 years ago

This would be very useful.

How difficult would it be do also add .svg support for vector images? PNGs often don’t look very sharp unless they have the exact size.

Just an idea… thanks.

From: Ryan Baumann Sent: Saturday, March 31, 2018 10:56 AM To: mapbox/mapboxgl-powerbi Cc: Subscribed Subject: [mapbox/mapboxgl-powerbi] Add symbol layer type (#87)

Proposal Developers want to be able to create icons to drop into their map visualization, in addition to circles, for point type data. This issue tracks adding symbol layer support to the Mapbox Visual for Power BI. Design

  1. Symbol layer should be a new layer type option in the Mapbox Visual for Power BI format panel.
  2. Symbol layer should contain the same viz class base layers as all other visualizations (visibility, opacity, minzoom, and maxzoom.)
  3. Symbol layer should allow users to select from a list of curated icons to use in their map.
  4. Symbol layer should allow users to add a PNG from a reference a URL to use as a custom icon. The URL should return an image in PNG format.
  5. Symbol layer should allow users to enable/disable collision detection between symbols when they overlap while zooming.
  6. Symbol layer should allow users to adjust the size and color of the icon based on data values, just like circles. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
ryanbaumann commented 6 years ago

@PedroRiveraTorresMoir yes, we can add support for any image type that can render out to a canvas element easily with the addImage API https://www.mapbox.com/mapbox-gl-js/api#map#addimage. Here's a basic developer example of using Mapbox GL JS to accept an SVG image (a triangle) and changing it's style (icon-color, halo-color, and icon-rotation) on-the-fly based on values in a point dataset .

I updated the design criteria in the OP to reflect supporting SVG icons - thanks!

otravers commented 5 years ago

A couple comments on this:

  1. This didn't make 1.3 so should be re-scoped (1.6?)

  2. Could this be done by implementing HTML markers? This demo got me salivating.

ryanbaumann commented 5 years ago

@otravers yes, we could implement this using HTML markers vs. symbols, especially with clustering. I would recommend adding that as a separate feature request.

otravers commented 5 years ago

Symbol layer should contain the same viz class base layers as all other visualizations (visibility, opacity, minzoom, and maxzoom.) Symbol layer should allow users to adjust the size and color of the icon based on data values, just like circles.

It might be worth also exposing some other properties as Power BI fields so they can be data-driven, such as icon-rotate, to mirror marker layer settings shown in this example built with Tibco Spotfire.

ZiZasaurus commented 4 years ago

I have a customer who would greatly appreciate the ability to use symbols (based on values) other than the default circle icon.