Set current location in the top half of the map in Android -


i paint current location on googlemap. showing half of map (the other half hidden under view, cannot change this).

i want move camera center top half of map in current location, can me this? there way set x , y of view want show current location?

i using google maps android api v2.

the google.maps.map class has method called setcenter takes in google.maps.latlng parameter. method centers map on given latlng. using clever code, first use getcenter() method on map determine true center of map, average latitude of latlng latitude of top of viewport. give latitude of new center. longitude of new center remain same. set map new coordinate pair , problem solved.

happy coding!

  • routemapper

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -