Skip to content
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

Use Mapbox GL Inspect for X-Ray View #103

Merged
merged 3 commits into from
Jan 10, 2017
Merged

Use Mapbox GL Inspect for X-Ray View #103

merged 3 commits into from
Jan 10, 2017

Conversation

lukasmartinelli
Copy link
Contributor

I built all the X-Ray functionality into https://github.com/lukasmartinelli/mapbox-gl-inspect.
I am using this from Maputnik as well so I can share all the x-ray/debug functionality.

For tileserver-gl this has the following advantages:

  • Show popup when hovering for vector
  • Also show polygons in X-Ray (not just outline)
  • Light mode (fits better to Tileserver GL because everything is white)
  • Show the inspect button on the vector maps as well to directly inspect vector underlying the styles

X-Ray:

screenshot from 2017-01-09 14-13-29

Viewer:

peek 2017-01-09 14-40

@klokan
Copy link
Member

klokan commented Jan 9, 2017

Great, thanks for the PR!

I believe, some people want to embed the fullscreen viewer with selected style zoomed to a defined place into websites/blog by iframe - just to show a place or map of given region to their web visitors.
The x-ray/inspect is too technical function for the standard end-user facing viewer - people may get confused in what is happening with the map...

IMHO It should be applied only for the data preview, if the style is not there. But this is my personal opinion only. We can discuss with @petrsloup and @daliborjanak, if this makes sense in the default style viewer in TileServerGL.

BTW did you switch all the colors and name because of the request at maplibre/maputnik#8 (comment)?
The code for x-ray (under this name) is in Mapbox Studio Classic which is 100% open-source code...

@lukasmartinelli
Copy link
Contributor Author

I believe, some people want to embed the fullscreen viewer with selected style zoomed to a defined place into websites/blog by iframe - just to show a place or map of given region to their web visitors.

Ah alright. If it is meant to embedd it via iFrame it should be removed from the style page!
One can provide a own color function to the inspect plugin http://mapbox-gl-inspect.lukasmartinelli.ch/examples/custom-color-1.html#3/40.00/-74.50
I can use the color function from before - I just didn't know from where it was copied from.
The colors in the default color function have an alpha value which makes overlaying polygons visible.

BTW did you switch all the colors and name
I believe, some people want to embed the fullscreen viewer with selected style zoomed to a defined place into websites/blog by iframe - just to show a place or map of given region to their web visitors.

Ah alright. If it is meant to embedd it via iFrame it should be removed from the style page!
One can provide a own color function to the inspect plugin http://mapbox-gl-inspect.lukasmartinelli.ch/examples/custom-color-1.html#3/40.00/-74.50
I can use the color function from before.

BTW did you switch all the colors and name because of the request at maplibre/maputnik#8 (comment)?
The code for x-ray (under this name) is in Mapbox Studio Classic which is 100% open-source code...

If think it's fair to not call it X-Ray since Tom asked so politely. Sometimes it's not all about licensing ;)
I call this mode Inspect in Maputnik - Tangram Play calls it Inspection mode as well.

@klokan
Copy link
Member

klokan commented Jan 9, 2017

+1 on everything - including the switch of colors and the name from X-Ray to Inspect - shown only for raw data.

The source of the original color palette (only for reference):
https://github.com/mojodna/tilelive-xray
https://github.com/mapbox/tilelive-vector/search?utf8=%E2%9C%93&q=xray&type=Issues

@petrsloup
Copy link
Member

@lukasmartinelli Look good, thanks! Can you please just remove the last commit from this PR so I can merge this as is?

@lukasmartinelli
Copy link
Contributor Author

@lukasmartinelli Look good, thanks! Can you please just remove the last commit from this PR so I can merge this as is?

Rebased and removed the commit.

@petrsloup petrsloup merged commit 473e7b6 into maptiler:master Jan 10, 2017
@petrsloup
Copy link
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants