androiddictionaryoverlayitem

How to set geopoint of an overlay item and put onto map correctly?


enter image description here

What I want to is display the item just above the line. How do I set item's position for doing that? (as shown in an second image as below)

enter image description here


Solution

  • It seems like currently your marker's center is bound to geopoint, but you want to bound marker's bottom.

    So in constructor of your overlay you need to call boundCenterBottom method like this

    public MyItemizedOverlay(Drawable defaultMarker) {
      super(boundCenterBottom(defaultMarker));
    }
    

    And may be you need to edit your marker image to place red point at bottom's center to horizontal center of image.

    Blue rectangle is approximate size of your image. As you can see marker's center is not in center of the image. Green rectangle is how image should be changed to make marker's center match image's center.

    enter image description here