p-lr / MapView

A Fast, memory efficient Android library to display tiled maps, with support for markers, paths, and rotation.
Apache License 2.0
184 stars 38 forks source link

Set initial scale #12

Closed dbof10 closed 4 years ago

dbof10 commented 4 years ago

Hi, thanks for the library. I'm new to this lib. I have some questions

  1. I want set the map with some initial scale value when it first renders
  2. In addition, I want to run some ValueAnimator to change scale value.
  3. Look at MapMarkersFragment, a callout is added every time marker is clicked. Does the lib remove the callout when tap outside?
p-lr commented 4 years ago

Hi,

  1. You can use setStartScale method on MapViewConfiguration builder. For example:
val config = MapViewConfiguration(5, 8192, 8192, tileSize, 
tileStreamProvider).setStartScale(1.5f)
  1. You can either use MapView.smoothScaleTo(destScale) or use your own animator and change the scale by setting a new value for the scale property of the MapView at each animation step.

  2. Yes the lib removes the callout when taping outside

dbof10 commented 4 years ago

Thank you

dbof10 commented 4 years ago

Actually there is one more question, after startScaleValue how to move it to specific region like camera api from google map?

p-lr commented 4 years ago

There's also the slideToAndCenterWithScale(x, y, scale) api.