Place Picker

Ví dụ này sử dụng eKMap Place Picker tích hợp dịch vụ truy vấn thông tin địa điểm.

Xem thêm các lựa chọn về Place Picker

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Place Picker</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://files.ekgis.vn/sdks/v2.0.0/ekmap-platform.min.js"></script>
<link href="https://files.ekgis.vn/sdks/v2.0.0/ekmap-platform.min.css" rel="stylesheet" />
<style>
body { margin: 0; padding: 0; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; background:#ddd;}
</style>
</head>
<body>
<div id="map"></div>
<script>
var apiKey = '{YOUR_API_KEY}';
var map = new maplibregl.Map({
container: 'map',
center: [105.85, 21],
zoom: 12,
});
/*eKmap Place Picker*/
var options = {
apiKey: apiKey,
map: map,
search: true,
callback: callback_method,
};
var picker = new ekmapplf.placePicker(options);
function callback_method(response) {
console.log(response);
alert(JSON.stringify(response));
}
</script>
</body>
</html>