Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Document units for MyLocationViewSettings.setPadding() #6765

Closed
zugaldia opened this issue Oct 19, 2016 · 2 comments
Closed

Document units for MyLocationViewSettings.setPadding() #6765

zugaldia opened this issue Oct 19, 2016 · 2 comments
Labels
Android Mapbox Maps SDK for Android

Comments

@zugaldia
Copy link
Member

Currently, the documentation for MyLocationViewSettings.setPadding(int left, int top, int right, int bottom) says the following:

Set the MyLocationView padding.
Parameters:
left - the padding left of MyLocationView
top - the padding top of MyLocationView
right - the padding right of MyLocationView
bottom - the padding bottom of MyLocaionView

(also, note the typo in that last MyLocaionView).

The documentation doesn't say the units for these parameters, let's add it. This is confusing, for example, because if we set a padding like:

map.getMyLocationViewSettings().setPadding(0, mapView.getHeight() / 2, 0, 0);

We'd expect the MyLocationView object to be at the bottom of the screen. However, the result is slightly different:

screenshot_20161019-153126

/cc: @tobrun @cammace

@tobrun
Copy link
Member

tobrun commented Oct 20, 2016

we divide the padding immediately by 2 when setting, this is needed for correctly calculating the center point for tilt offset later on but is now also taking into account when caculating location on screen. Workaround for now is doubling the value.

@tobrun
Copy link
Member

tobrun commented Aug 14, 2017

MyLocationView is going to be replaced with LocationLayer.

@tobrun tobrun closed this as completed Aug 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

3 participants