Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.2 KB

File metadata and controls

45 lines (34 loc) · 1.2 KB

💚 This is the latest document.

map.setMyLocationButtonEnabled()

Set true if you want to show the MyLocation button.

marker.setMyLocationButtonEnabled(flag);

Parameters

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

Demo code

<div class="map" id="map_canvas">
    <span class="smallPanel"><button>current: map.myLocationButton = 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.setMyLocationButtonEnabled(isEnabled);
  button.innerHTML = "current: map.myLocationButton = " + isEnabled;
});