Giter Site home page Giter Site logo

maplibre / maplibre-gl-inspect Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 5.0 1.48 MB

Maplibre GL Inspect adds an inspect control to maplibre-gl-js to view all features of the vector sources and allows hovering over features to see their properties.

Home Page: https://maplibre.org/maplibre-gl-inspect/

License: BSD 3-Clause "New" or "Revised" License

JavaScript 1.21% CSS 8.67% TypeScript 90.12%
gis hacktoberfest inspector maplibre maplibre-gl-js

maplibre-gl-inspect's Introduction

MapLibre Organization

https://www.maplibre.org/

This repository contains various documents that define the MapLibre Organization such as the Charter, our Code of Conduct, the list of Voting Members, and more.

You also find here the results of past Governing Board elections.

Formatting

Markdown files in this repo are formatted with markdownlint. If you have formatting problems you can sometimes fix them with:

npx markdownlint-cli *.md --fix

maplibre-gl-inspect's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

maplibre-gl-inspect's Issues

Some issues getting started

First off, thanks for continuing this plugin!

I'm having some issues getting started with it. I've tried both in a Nuxt (Vue 3) app with build tooling and modules as well as fairly standalone web pages.

I've put together a JSFiddle which appears to be a fairly minimal reproducible example: https://jsfiddle.net/L0uznyja/

Summary of issues:

  • Wonky text formatting in popup (see screenshot; I expected it to be a bit more... columnar?)
  • Setting showInspectMap: true doesn't actually change the style, at least in the case of a non-trivial style. However, the popups show up over the main style (also shown in screenshot)
  • The icon for the button doesn't load
  • Toggling to the inspect view just shows a white map. No issues are indicated in the browser or JSFiddle console.
image

It's quite probable that I'm just "holding it wrong" as I'm not much of a frontend dev to be honest :) Thanks in advance!

Changing a style causes failure

In maplibre 4 when using setStyle with diff: true, maplibre knows how to replace the map correctly without the former bailout.
Due to this "new" behavior if you setStyle with more than one source diff it may fail since render is called in the middle of the switch after the first source has changed.

Steps to reporduce:

  1. initialize a map with a style that have a few sources and layers linked to them
  2. call map.setStyle('new-style-url', {diff: true)
  3. See the following error in the condole (for example): Source "Contour" cannot be removed while layer "Contour_contour_circle" is using it.

This is caused due to the setStyle inside render called due to the source changed event.

This is also described here:

Solution:
Throttle the source changed calls with trail so that if there are multiple sources changes it will do them after the style has completed the transition.

Popup doesn't work correctly in some scenario

See the following issue:
maplibre/maputnik#576

Steps to reproduce:

  1. Open inspect with the following configuration:
showMapPopup: true,
showMapPopupOnHover: false,
showInspectMapPopupOnHover: true,
blockHoverPopupOnClick: true,
  1. click the map: popup is correctly displayed
  2. switch the view to "Inspect"
  3. click the map: popup is correctly displayed
  4. switch the view back to "Map"
  5. click the map: no popup is displayed

This is basically due to bad state condition when switching from one to the other.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.