mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
26 lines
458 B
TypeScript
26 lines
458 B
TypeScript
import * as L from 'leaflet';
|
|
import 'leaflet.locatecontrol';
|
|
|
|
const map = L.map('map', {
|
|
center: [51.505, -0.09],
|
|
zoom: 13
|
|
});
|
|
|
|
// Defaults
|
|
L.control.locate().addTo(map);
|
|
|
|
// Simple
|
|
const lc = L.control.locate({
|
|
position: 'topright',
|
|
strings: {
|
|
title: "Show me where I am, yo!"
|
|
}
|
|
}).addTo(map);
|
|
|
|
// Locate Options
|
|
map.addControl(L.control.locate({
|
|
locateOptions: {
|
|
maxZoom: 10,
|
|
enableHighAccuracy: true
|
|
}}));
|