חיפוש גוש/חלקה לכתובת או כתובת לגוש/חלקה
פונקציה זו מבצעת חיפוש מרחבי של כתובת/כתובות הנמצאות בגוש/חלקה נתון או חיפוש מרחבי של גוש וחלקה המכילים כתובת נתונה.
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>
תוצאות חיפוש גוש חלקה לכתובת:
[
{
"ObjectId": 145758377,
"Created": "0001-01-01T00:00:00",
"IsEditable": true,
"Values": [
40095,
13
]
}
]
<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.addressToLotParcel,
lot: 40095,
parcel:13
}
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>
תוצאות חיפוש גוש חלקה לכתובת:
[
{
"ObjectId": 1381,
"Created": "0001-01-01T00:00:00",
"IsEditable": true,
"Values": [
"אילת",
"עין גדי",
32
]
},
{
"ObjectId": 57,
"Created": "0001-01-01T00:00:00",
"IsEditable": true,
"Values": [
"אילת",
"עין גדי",
26
]
},
{
"ObjectId": 1,
"Created": "0001-01-01T00:00:00",
"IsEditable": true,
"Values": [
"אילת",
"עין גדי",
28
]
}
]