💚 This is the latest document.
Set true if you want to show the MyLocation control (blue dot).
- Please read here: The myLocation property has changed! since v2.2.0
marker.setMyLocationEnabled(flag);
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;
});