Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.16 KB

File metadata and controls

43 lines (33 loc) · 1.16 KB

💚 This is the latest document.

map.setMyLocationEnabled()

Set true if you want to show the MyLocation control (blue dot).

marker.setMyLocationEnabled(flag);

Parameters

name type description
flag boolean false: disabled, true: enabled

<div class="map" id="map_canvas">
    <span class="smallPanel"><button>current: map.myLocation = true</button></span>
</div>
var map = plugin.google.maps.Map.getMap(div, {
  controls: {
    myLocationButton: true,
    myLocation: true
  }
});

var isEnabled = true;
var button = div.getElementsByTagName('button')[0];
button.addEventListener('click', function() {
  isEnabled = !isEnabled;
  map.setMyLocationEnabled(isEnabled);
  button.innerHTML = "current: map.myLocation = " + isEnabled;
});