mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

[Android] queryRenderedFeatures large building problem

Open P-Zenker opened this issue 8 years ago • 2 comments

Hey!

Platform: Android Mapbox SDK version:

    api('com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.1') {
        transitive = true
    }

Also present in 6.0.0-SNAPSHOT (6.0.0-beta.4).

Device: Motorola Nexus 6 (Android 7.1.1) and Samsung Galaxy S3 (GT-I9300, Android 4.3)

Steps to trigger behavior

  1. Copy SelectBuildingActivity.java from Android Demo Project
  2. Try to select a large building at different LatLng

Expected behavior

Select a (large) building at every zoom level

Actual behavior

1. I couldn't select a very large building at every zoom level. For smaller buildings, however, there were no problems.

ezgif com-video-to-gif1

This log belongs to the gif above

03-28 14:11:04.128  LatLng: 53.83538820018208, 10.707320612146646 , Zoom: 18.443730633366147
03-28 14:11:04.150  Features found: 3
03-28 14:11:04.848  LatLng: 53.83509461006457, 10.706863098144595 , Zoom: 18.443730633366147
03-28 14:11:04.862  Features found: 3
03-28 14:11:05.539  LatLng: 53.83497424747276, 10.707280044390018 , Zoom: 18.443730633366147
03-28 14:11:05.548  Features found: 2
03-28 14:11:08.805  LatLng: 53.83499557104332, 10.706742026040047 , Zoom: 16.96581346709141
03-28 14:11:08.818  Features found: 3
03-28 14:11:09.453  LatLng: 53.8353789948373, 10.707131248096971 , Zoom: 16.96581346709141
03-28 14:11:09.461  Features found: 2
03-28 14:11:10.109  LatLng: 53.835433637031, 10.707795122718949 , Zoom: 16.96581346709141
03-28 14:11:10.125  Features found: 3
03-28 14:11:10.714  LatLng: 53.834998349506435, 10.707467109098843 , Zoom: 16.96581346709141
03-28 14:11:10.724  Features found: 2
03-28 14:11:13.633  LatLng: 53.83490832831032, 10.706838884941703 , Zoom: 15.777773795949601
03-28 14:11:13.646  Features found: 2
    instanceof Polygon = true

OSM bildschirmfoto 2018-03-28 um 13 46 51

I know that this building isn't recorded correctly at the holes. Bus as you can see in this gif, there is a rendering issue, because this doesn't work:

        if (selectedBuilding != null) {
            mapboxMap.removePolygon(selectedBuilding);
        }

ezgif com-video-to-gif

The selected building should be deselected (=removed from map) after selecting another building.

P-Zenker avatar Mar 28 '18 13:03 P-Zenker

I couldn't select a very large building at every zoom level. For smaller buildings, however, there were no problems.

SelectBuildingActivity.java in the demo app only support sPolygon type building geometry. The building you are referring to in this ticket is a MultiPolygon type, and not supported in the demo app activity.

Can you create a minimal sample depicting the removePolygon issue in #2 above.

asheemmamoowala avatar Mar 31 '18 00:03 asheemmamoowala

Ok, removePolygon doesn't work on the MultiPolygon showed above. If you don't support it, then it is not an issue ;)

P-Zenker avatar Apr 03 '18 08:04 P-Zenker