Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 712 Bytes

File metadata and controls

33 lines (24 loc) · 712 Bytes

💚 This is the latest document.

map.getCameraTarget()

Get the current camera target(latitude/longitude) position.


Demo code

<div class="map" id="map_canvas">
    <span class="smallPanel"><button>Click here</button></span>
</div>
var div = document.getElementById("map_canvas");
var map = plugin.google.maps.Map.getMap(div);
var button = div.getElementsByTagName('button')[0];
button.addEventListener('click', function() {

    // Show the current camera target position.
    var target = map.getCameraTarget();
    alert([
      "lat: " + target.lat,
      "lng: " + target.lng
    ]);
});