TransWikia.com

How to use ground overlay google map android for polygon area to fit the map image in it?

Geographic Information Systems Asked by nIMaaZx on February 2, 2021

I have a park area that is not rectangle or a simple shape. It is just like polygon area. I could load sample image on it for testing, in my android app.
There it is :

enter image description here

mGroundOverlayRotated = googleMap.addGroundOverlay(
    GroundOverlayOptions()
        .image(mImages[0])
        .position(LatLng_NEAR_NEWARK, 255f, 84f)
        .bearing(110f)

It is worked for simple shape like rectangle.

  1. LatLng_NEAR_NEWARK is latitude/longitude of center of park.
  2. 255f is width of area in meter.
  3. 84f is height of area.

I cannot using width/height for the area like this.
I can’t figure out how to use Position function in my code to fit it.

enter image description here

I need something like this :

enter image description here

https://stackoverflow.com/questions/26250481/show-only-ground-overlays-map-android

I saw something about KML format. I’m not sure about it. Should I use SVG/PNG format for this area instead of JPG?

What approach do I use?

One Answer

Maybe they used the tile provider API instead of the ground overlay. https://developer.here.com/apiexplorer-v2-sample-data/template-web-default/examples/custom-tile-overlay/index.html

https://developers.google.com/maps/documentation/android-sdk/tileoverlay

Or just make the image opaque, so in reality it is a squared GroundOverlay, but through the opacity it seems like the image has the specific form you want.

Answered by Julian Schweppe on February 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP