Search code examples
androidskmaps

In the Skobbler API, what unit is Annotation.setOffset() in


When setting a custom image for the map markers (Annotations) on a Skobbler map, one can set the offset of the image using SKAnnotation.seOffset(SKScreenPoint), so that the marker can line up proprly with the exact location of gps coordinates, but the documentation is not clear on what the unit of measurement is for SKScreenPoint or how the offset is calculated.

Is the offset in dip, px, or something else.

Is there a built in way to handle different screen densities using, or do I need to calculate the value based on screen density?


Solution

  • Offset in px. For example, to set anchor point from center to bottom of annotation offset should be half of height:

    annotation.setOffset(new SKScreenPoint(0 /*x*/, annotation_height/2 /*y*/));