Postavljanje markera
Prikaz markera na mapi na željenoj poziciji u željenom nivou zumiranja.
HTML Kopiraj
<!DOCTYPE html>
<html>
<head>
<title>Postavljanje markera</title>
<script src="https://maps-api.planplus.rs/script/maplibre/maplibre-gl/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"></script>
<link href="https://maps-api.planplus.rs/style/maplibre/maplibre-gl.css" rel="stylesheet" />
</head>
<body>
<div id="map" style="width: 500px; height: 500px;"></div>
<script>
// vaša licenca
var lid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
// instanciranje mape
var map = new maplibregl.Map({
container: 'map',
style: 'https://vt.planplus.rs/mapstyle/PPMapaStyle.json?lid=' + lid,
center: [20.424476, 44.813864 ],
zoom: 11
});
// instanciranje i postavljanje markera
var marker = new maplibregl.Marker()
.setLngLat([20.424476, 44.813864 ])
.addTo(map);
</script>
</body>
</html>