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

קבלת מקרא שכבות של המפה

פונקציה זו מחזירה את מקרא שכבות של המפה.

govmap.getLayerRenderer(param);

האובייקט הנשלח לפונקציה

שםסוגתיאור
LayerNames[]stringשמות השכבות בעבורן מבקשים לקבל מקרא

דוגמה לקבלת מקרא שכבות של המפה :

<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: "1",
layersMode: 1,
zoomButtons:false
});
}
function showExample() {
var param = {
LayerNames: ['GASSTATIONS']
};
govmap.getLayerRenderer(param).then(
function(response) {
console.log(response);
});
}
</script>
</head>
<body>
<div id="map" style="width:600px;height:600px;"></div>
<button onClick="showExample()">Show Example</button>
</body>
</html>

דוגמה לקבלת מקרא

{
"active": false,
"data": {
"renderers": [
{
"layerName": "gasstations",
"layerCaption": "תחנות דלק",
"titles": [
"אחר",
"דור אלון",
"דלק",
"סד\"ש",
"סונול",
"טן",
"פז"
],
"images": [
"data:image/png;base64,iVB..."
]
}
]
},
"errorCode": 0,
"message": null,
"status": 0
}