שינוי שדה חישוב של מפת חום
פונקציה זו מאפשרת שינוי השדה שעליו מתבססים ליצירת מפת החום לאחר הוספת מפת חום על המפה. פונקציה זו מקבלת כפרמטר מחרוזת שם השדה חישוב החדש.
govmap.changeHeatLayerValueField(params);
דוגמה למחיקת מפת חום
<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
});
}
var params = {
points: [
{ point: { x: 100000, y: 200000 }, attributes: { val1: 50, val2: 800 } },
{ point: { x: 200000, y: 400000 }, attributes: { val1: 100, val2: 700 } },
{ point: { x: 200100, y: 400000 }, attributes: { val1: 200, val2: 600 } },
{ point: { x: 200200, y: 400000 }, attributes: { val1: 300, val2: 500 } },
{ point: { x: 200300, y: 400000 }, attributes: { val1: 400, val2: 400 } },
{ point: { x: 200400, y: 400000 }, attributes: { val1: 500, val2: 300 } },
{ point: { x: 200500, y: 400000 }, attributes: { val1: 600, val2: 200 } },
{ point: { x: 200600, y: 400000 }, attributes: { val1: 700, val2: 100 } },
{ point: { x: 300000, y: 400000 }, attributes: { val1: 800, val2: 50 } }
],
options: { valueField: 'val1' }
};
govmap.setHeatLayer(params);
function showExample() {
govmap.changeHeatLayerValueField('val1');
}
</script>
</head>
<body>
<div id="map" style="width:600px;height:600px;"></div>
<button onClick="showExample()">Show Example</button>
</body>
</html>