mapboxgl-powerbi icon indicating copy to clipboard operation
mapboxgl-powerbi copied to clipboard

Add symbol layer type

Open ryanbaumann opened this issue 6 years ago • 6 comments

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.

ryanbaumann avatar Mar 31 '18 16:03 ryanbaumann

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.

PedroRiveraTorresMoir avatar Mar 31 '18 17:03 PedroRiveraTorresMoir

@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!

ryanbaumann avatar Mar 31 '18 18:03 ryanbaumann

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.

otravers avatar Jun 16 '19 15:06 otravers

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

ryanbaumann avatar Jun 18 '19 20:06 ryanbaumann

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.

otravers avatar Jun 20 '19 13:06 otravers

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

ZiZasaurus avatar Oct 16 '19 19:10 ZiZasaurus