דלג לתוכן הראשי

הסרת סמן (marker) מהמפה

פונקציה זו מסירה מהמפה את הסמן.


govmap.clearMapMarker();

דוגמה להסרת סימון מהמפה:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="https://www.govmap.gov.il/govmap/api/govmap.api.js" defer onload="initGovMap()"></script>
<script type="text/javascript">
function initGovMap() {
govmap.createMap('map', {
token: 'YOUR_API_TOKEN',
layers: ["GASSTATIONS","PARCEL_HOKS", "KSHTANN_ASSETS", "bus_stops", "PARCEL_ALL"],
showXY: true,
identifyOnClick: true,
isEmbeddedToggle: false,
background: 3,
layersMode: 1,
zoomButtons:false,
onLoad: () => govmap.zoomToXY({ x: 176085, y: 657600, level: 10, marker: true })
});
}

function showExample() {
govmap.clearMapMarker();
}
</script>
</head>
<body>
<div id="map" style="width:600px;height:600px;"></div>
<button onClick="showExample()">Show Example</button>
</body>
</html>