Rapid icon indicating copy to clipboard operation
Rapid copied to clipboard

Custom Data - add color picker

Open bhousel opened this issue 2 years ago • 5 comments

Followup from the recent PMTiles / Vector Tiles work: #1016

We should add a color picker to the custom data, it's all just cyan #00ffff for now

bhousel avatar Aug 31 '23 04:08 bhousel

Remember to increase the height of where custom data could be seem sim different zoom levels

jjiglesiasg avatar Aug 31 '23 06:08 jjiglesiasg

It might also be an option to allow using style data via the simple style spec like geojson.io and others do: image

  • Maybe only the line color stroke property to change the color
  • Maybe the Rapid colorpicker could overwrite this value when needed

tordans avatar Aug 31 '23 09:08 tordans

Now if you add some custom data widespread geographically, the aerial image goes to all the area that the custom data covers, and you lose where you was, I guess it should remain where you are working and show the custom data on that location...

jjiglesiasg avatar Sep 01 '23 23:09 jjiglesiasg

I'd like to try this one @Bonkles

lauble avatar Oct 18 '23 19:10 lauble

@lauble Here are some notes!

We have an existing color picker that is used inside the Rapid button in the top of the UI:

image

Code pointer: https://github.com/facebook/Rapid/blob/main/modules/ui/rapid_colorpicker.js

Straight-up reusing most of this component and placing it inside the custom data section of the sidebar would be excellent. Here's where I'm talking about: image

To get there, hit 'f' to bring up the data sidebar, or click the icon in the right-hand sidebar labeled 'Map Data'.

When you get to the point where you want to test your component, here's how you can load some custom data for testing:

Click the Three-dot menu to open the custom data dialog, once there you can enter this URL to load a TON of places data all over the world (Just keep zooming your browser in until you see something):

https://r2-public.protomaps.com/protomaps-sample-datasets/overture-pois.pmtiles

Hit enter, the data should start loading once you zoom in enough.

Notice that the URL of the window has added it as &data=https://r2-public.protomaps.com/protomaps-sample-datasets/overture-pois.pmtiles.

All the data just uses the same light teal-ish color, which should look like:

image

Good luck!

Bonkles avatar Oct 18 '23 23:10 Bonkles