here-android-sdk-examples
here-android-sdk-examples copied to clipboard
Android How to get metersPerPointAtZoomLevel
/**
- Get the screen-space to world-space conversion factor at a specified zoom level.
- @param zoomLevel The zoom level at which to retrieve the conversion factor.
- @return The conversion factor in meters per point.
- @note The conversion factor is based on a straight-line distance between two points;
- that is, it does not take into account the curvature of the Earth. */
- (float)metersPerPointAtZoomLevel:(float)zoomLevel;
This method is in the ios sdk.
Hi @NazarKacharaba , How to calculate this value in the android?
Use following Map API to calculate meters per pixel value:
/**
* Returns a map scale value based on the specified zoom level. Scale units are in physical geo
* centimeters per screen inch.
*
* @param level
* The zoom level to be translated to a map scale.
* @return Scale value for the passed {@code level}. Units are in geo centimeters per screen
* inch
*/
@HybridPlus
public double getScaleFromZoomLevel(double level) {
return m_pimpl.getScaleFromZoomLevel(level);
}
Use following Map API to calculate meters per pixel value:
/** * Returns a map scale value based on the specified zoom level. Scale units are in physical geo * centimeters per screen inch. * * @param level * The zoom level to be translated to a map scale. * @return Scale value for the passed {@code level}. Units are in geo centimeters per screen * inch */ @HybridPlus public double getScaleFromZoomLevel(double level) { return m_pimpl.getScaleFromZoomLevel(level); }
Thank you, @NazarKacharaba. But how to calculate? Can you help to provide it in detail?