GLMap / examples-android

Android demo application for GLMap framework

Home Page:https://globus.software

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Precision too low for indoor scenario

jerzykiler opened this issue · comments

Hello,

I am trying to use your map framework (version 1.0.4) for indoor scenario and I am facing two problems.

Problem 1:
The precision of drawing vector objects seems too low.
For a geojson with a small enough rectangle it shows a line (diagonal) instead of a rectangle (on both android and iOS):

Geojson:

{
"type": "FeatureCollection",
"features": [
{
  "type": "Feature",
  "id": "way/-128750",
  "properties": {
    "indoor": "room",
    "id": "way/-128750"
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [
          20.98196842481,
          52.2112172242
        ],
        [
          20.98200601232,
          52.21121723862
        ],
        [
          20.98200600068,
          52.21122863201
        ],
        [
          20.98196841317,
          52.21122861759
        ],
        [
          20.98196842481,
          52.2112172242
        ]
      ]
    ]
  }
}
]
}

(BTW: You have to strip the:

{
"type": "FeatureCollection",
"features": 
...
}

wrapper-part, leaving only the features-array from this geojson to work with GLMap.)

line_instead_of_rectangle_iOS

Problem 2:
The maximum zoom on android is a lot smaller than max zoom on iOS.
The max zoom on iOS is OK for me so it would be really awesome if the max zoom on android was the same.

(same example geojson file)

Max zoom on Android (LG G2 Android 5.0.2):
line_instead_of_rectangle_android_max_zoom

Max zoom on iOS (iPhone SE iOS 12.1):
line_instead_of_rectangle_iOS_max_zoom

I provided all files in the arch.zip

Thank you for your time.

Cheers

Hello,

  1. That is an issue with simplification of geometry. It will be fixed in next release. Thanks for reporting this issue!
    FYI when GeoJSON is parsed all coordinates are projected and stored as 32bit integers (from 0 to GLMapPointMax). So accuracy at equator will be LengthOfEquator/GLMapPointMax = 40075000m/2^30 ~= 0.037m.
    If you will need better precision you can load your data without projection and use position and scale of Drawable to set proper position of object. As an example you can check CurLocationHelper.java.
  2. There is property maxZoom in GLMapView. Change it if you need more detailed zoom.
  1. Thank you for the tip, I will check it out.

  2. I'm sorry if I don't see something but when I write (in android, kotlin):

var mapView: GLMapView = findViewById(R.id.map_view)

mapView.maxZoom = 22.0   <-- there is no maxZoom property

// I can do:
mapView.mapZoom = 22.0 <-- but it won't get bigger than 20.0 whatever I set here

Is there any other way to set the maxZoom property ?

I'm sorry if I don't see something but when I write (in android, kotlin):

var mapView: GLMapView = findViewById(R.id.map_view)

mapView.maxZoom = 22.0   <-- there is no maxZoom property

// I can do:
mapView.mapZoom = 22.0 <-- but it won't get bigger than 20.0 whatever I set here

Is there any other way to set the maxZoom property ?

This property for Android will be in next release. At this moment it is only in iOS ...

Was fixed in 1.1.0