חיפוש גוש/חלקה לכתובת או כתובת לגוש/חלקה
פונקציה זו מבצעת חיפוש מרחבי של כתובת/כתובות הנמצאות בגוש/חלקה נתון או חיפוש מרחבי של גוש וחלקה המכילים כתובת נתונה.
govmap.searchAndLocate(params);
האובייקט הנשלח לפונקציה
| שם פרמטר | סוג | תיאור |
|---|---|---|
| type | enum govmap.locateType | סוג החיפוש המבוקש: addressToLotParcel lotParcelToAddress |
| address | string | כתובת - במידה והחיפוש מת בצע לגוש/חלקה לכתובת |
| lot | number | גוש – במידה והחיפוש מתבצע לפי כתובת לגוש/חלקה |
| parcel | number | חלקה – במידה והחיפוש מתבצע לפי כתובת לגוש/חלקה |
הפונקציה מחזירה מערך של אובייקטים שהם תוצאות החיפוש
דוגמא חיפוש גוש חלקה לכתובת:
<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 params = {
type:govmap.locateType.lotParcelToAddress,
address: 'עין גדי 32, אילת'
}
govmap.searchAndLocate(params).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>