GLMap / examples-android

Android demo application for GLMap framework

Home Page:https://globus.software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pin location seems like changing when zooming out

jerzykiler opened this issue · comments

I've found a bug in all versions from 1.0.1 above (including 1.1.0).

In version 1.0.0 it is working fine.

I am adding a Pin like that:

    internal fun addPin(lat: Double, lon: Double) {
        if (pins == null)
            pins = Pins(this)

        if (imageGroup == null) {
            imageGroup = GLMapImageGroup(pins, 3)
            mapView.add(imageGroup)
        }

        val pin = Pin()
        pin.pos = MapPoint.CreateFromGeoCoordinates(lat, lon)
        pin.imageVariant = 0
        pins!!.add(pin)
        imageGroup!!.setNeedsUpdate(false)
    }

Pin(lat = 52.2117947426 lon = 20.981752462)

It's easy to see in relation to this box in geojson:

[
{
  "type": "Feature",
  "id": "way/-130506",
  "properties": {
    "id": "way/-130506"
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          20.98182189335,
          52.21173087973
        ],
        [
          20.98182199255,
          52.21188518947
        ],
        [
          20.9817045864,
          52.21188521781
        ],
        [
          20.9817044872,
          52.21173090807
        ],
        [
          20.98182189335,
          52.21173087973
        ]
      ]
    ]
  }
}
]

When I zoom in and out it seems like the Pin moves on the map, like its position changes.
It seems like the layer on which the Pin is drawn is not updating at the same scale as the map layer underneath.

Also the initial placement of the Pin looks different between version 1.0.0 and above versions.

Sorry for long response.
In version 1.1.1+ it will be fixed.

In the latest version I use 1.2.2 this is fixed for android but it is still present on iOS.