Giter Site home page Giter Site logo

Comments (21)

gregwolanski avatar gregwolanski commented on May 19, 2024 2

If that's not possible then we could probably just show one feature in the popup and mark it in someway stating there are multiple to the user. How about water (x3) to show there are 3 duplicate layers for example.

I think “water × 3” works better than “water (×3)”. It’s easier to read.

1

Let me know what do you think, @orangemug and @pathmapper, and then I’ll create a pull request.

from maputnik.

orangemug avatar orangemug commented on May 19, 2024 2

Released in v1.1.0. Congrats @gregorywolanski it works great!

from maputnik.

orangemug avatar orangemug commented on May 19, 2024 1

Yes I remember fixing it.

Yeah I'm a little confused as well with the comment @lukasmartinelli. I'm assuming there was an issue that was fixed. However as @gregorywolanski points out there is still an issue here. We appear to have 2 features with the same id underneath the cursor, as shown in the following

with-same-id

In addition to this it is possible to have 2 features with the same name and different ids under the cursor.

with-diff-id

So in my opinion there are 2 parts to the issue here

  1. A user can't tell 2 features with different ids apart from each other
  2. Why are we getting 2 features with the same id?

We can fix the first part of the issue by adding the feature id to the features in the inspector popup. As shown below.

altered-diff-id

altered-same-id

What's everyones thoughts on this???

As for the second part of the issue I have no idea why that's happening. It sounds like @pathmapper might have some insight though.

Note: All the above can be viewed with the 'OSM Liberty' style loaded at the following zoom level / position https://maputnik.github.io/editor/#13.87/52.2130/21.0408

from maputnik.

pathmapper avatar pathmapper commented on May 19, 2024 1

My thoughts on this:

  1. The initial issue is fixed:

Because there is a style for all the data and an additional style to highlight the current layer
the popup shows the same feature twice.

This is what @lukasmartinelli remembered and it is also visible in inspect mode that this is not an issue anymore:

image

image


  1. What we are seeing in the following screenshot is related to the buffer of the vector tiles:

image

If you are moving the mouse pointer a little bit up or down it looks like this:

image

"Inside" the buffer features are duplicated from adjacent tiles.
So in inspect mode Maputnik is showing what is in the tiles. This is nothing wrong, the question is only if it is wanted to show it this way or to filter out duplicated features because of buffers (= don't show features in buffers)

More on buffers:

https://www.mapbox.com/vector-tiles/specification/#encoding-geom
https://www.mapbox.com/vector-tiles/specification/#clipping

See also:
https://github.com/mapbox/tippecanoe#controlling-clipping-to-tile-boundaries


  1. A feature which expands over several tiles may have a different ID for each tile, see this issue (same I linked before): openmaptiles/openmaptiles#303

It looks like the schema page does not specify how are are object ID-s set in the vector tiles. They seem to be sequential for every tile (1,2,3...), right? Now when there are several copies of same objects (e.g. POIs) due to buffers, then the same object in different tile will have different ID.

This is something which will be hopefully fixed in OpenMapTiles soon:

This could be easily achieved by copying a "natural" global UID, e.g. osm_id value from OSM database to object IDs

Looking at the feature ID could have several meanings at the moment:
IDs are the same -> same feature whithin 1 tile
IDs are the same -> different features of adjacent tiles, but having the same ID (by accident)
IDs are the same -> same feature exapanding over adjacent tiles, but having the same ID (by accident)

from maputnik.

orangemug avatar orangemug commented on May 19, 2024 1

@gregorywolanski so I guess the first thing to work out is this possible

I would prefer to remove the duplicates related to buffers in the inspect view of Maputnik if possible.

If so then lets do that.

If that's not possible then we could probably just show one feature in the popup and mark it in someway stating there are multiple to the user. How about water (x3) to show there are 3 duplicate layers for example. This means we're still telling the user the truth about the data source but not showing duplicate data to them.

With regards to

...it would be useful to have an option to display the tile boundaries

Let open a new issue for that and work out where we'd put that option in the UI

Does that sound good @pathmapper ?

from maputnik.

pathmapper avatar pathmapper commented on May 19, 2024 1

@orangemug thanks, sounds good!

Just noticed that the mentioned issue Use globally unique object ID-s has been added to the v3.7 milestone of Openmaptiles, so maybe it will be part of the next release.

With unique object ID-s it should be possible to filter/remove the duplicates for OpenMapTiles, but maybe there is a way to remove the duplicates which would work for all vector tiles sources (if this issue exists also with other sources).

from maputnik.

orangemug avatar orangemug commented on May 19, 2024 1

Looks good to me @gregorywolanski

from maputnik.

orangemug avatar orangemug commented on May 19, 2024

I can't reproduce the issue... have you fixed this already?

from maputnik.

lukasmartinelli avatar lukasmartinelli commented on May 19, 2024

I can't reproduce the issue... have you fixed this already?

I don't remember haha. Could be that I explicitly filter out what is currently in inspect mode.
Inspect mode is quite a hack to be honest.

If it doesn't occur anymore we can close it.

from maputnik.

gregwolanski avatar gregwolanski commented on May 19, 2024

I tried to reproduce the issue. I guess I made it.

If you could confirm it, I’ll be happy to dive into the codebase of Maputnik to try to fix the bug. :)

screenshot

from maputnik.

orangemug avatar orangemug commented on May 19, 2024

Hi @gregorywolanski thanks for a sample of the issue. So I think I know what's going on and I think it's kind of 'correct'. So I believe what is happening is that there are actually 2 overlapping features under the cursor in the source data. I added some logging in src/components/map/FeatureLayerPopup.jsx quickly and it looks like the feature.id is different in each case.

    // Just a snippet from src/components/map/FeatureLayerPopup.jsx
    const items = Object.keys(sources).map(vectorLayerId => {
      const layers = sources[vectorLayerId].map((feature, idx) => {
        console.log(">>>", vectorLayerId, feature.id);

I think the solution here is probably to also display the feature id in the inspect view. Note this will need doing in two places

  • map inspect view - clicking on the map in normal mode
  • inspect view - clicking on the inspect view in the toolbar

I'm open to other solutions also, let me know your thoughts.

from maputnik.

pathmapper avatar pathmapper commented on May 19, 2024

Hi, @orangemug do you suppose these are two different features? I am asking because it could be a feature "ovelapping itself" because of buffers if feature.id is what is described here as object ID-s: openmaptiles/openmaptiles#303

from maputnik.

orangemug avatar orangemug commented on May 19, 2024

...do you suppose these are two different features?

@pathmapper I believe so but I'm not 100%, I only took a quick look. @gregorywolanski are you able to take a look and confirm?

from maputnik.

gregwolanski avatar gregwolanski commented on May 19, 2024

screen shot 2017-10-13 at 19 11 14

from maputnik.

lukasmartinelli avatar lukasmartinelli commented on May 19, 2024

from maputnik.

gregwolanski avatar gregwolanski commented on May 19, 2024

How should I understand that? :)

from maputnik.

gregwolanski avatar gregwolanski commented on May 19, 2024

@pathmapper

  1. Do you know any case in which duplicates could be useful?

from maputnik.

pathmapper avatar pathmapper commented on May 19, 2024

@gregorywolanski Only very rare cases for debugging like clipped labels at tile boundaries. I would prefer to remove the duplicates related to buffers in the inspect view of Maputnik if possible. Instead it would be useful to have an option to display the tile boundaries (https://www.mapbox.com/mapbox-gl-js/api/#map#showtileboundaries).

from maputnik.

gregwolanski avatar gregwolanski commented on May 19, 2024

OK, guys, how do you decide what to do with such issues in this project? :) Can I help in any way? :]

from maputnik.

gregwolanski avatar gregwolanski commented on May 19, 2024

@orangemug Can you please mail me at [email protected]?

from maputnik.

orangemug avatar orangemug commented on May 19, 2024

@gregorywolanski message waiting in your inbox

from maputnik.

Related Issues (20)

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.