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

חיפוש גוש/חלקה לכתובת או כתובת לגוש/חלקה

פונקציה זו מבצעת חיפוש מרחבי של כתובת/כתובות הנמצאות בגוש/חלקה נתון או חיפוש מרחבי של גוש וחלקה המכילים כתובת נתונה.

govmap.searchAndLocate(params);
שם פרמטרסוגתיאור
typeenum govmap.locateTypeסוג החיפוש המבוקש:
addressToLotParcel
lotParcelToAddress
addressstringכתובת - במידה והחיפוש מתבצע לפי גוש/חלקה לכתובת
lotnumberגוש – במידה והחיפוש מתבצע לפי כתובת לגוש/חלקה
gushSuffixnumberתת-גוש – רשות. במידה והחיפוש מתבצע לפי כתובת לגוש/חלקה
parcelnumberחלקה – במידה והחיפוש מתבצע לפי כתובת לגוש/חלקה

הפונקציה מחזירה מערך של אובייקטים שהם תוצאות החיפוש. במידה ובאיבר קיים תת-גוש, יתווסף שדה gushSuffix.

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


<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","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>

תוצאות חיפוש גוש חלקה לכתובת:​

{
"active": false,
"data": [
{
"ObjectId": 175751,
"Values": [
40095,
13
],
"settlementCode": 2600,
"streetCode": 634,
"gushSuffix": null
}
],
"errorCode": 0,
"message": null,
"status": 0
}

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


<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',
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);
});
}
function showExample2(){
var params = {
type:govmap.locateType.addressToLotParcel,
lot: 100231,
parcel: 60
}
govmap.searchAndLocate(params).then(function(response){
console.log(response);
});
}
function showExample3(){
var params = {
type:govmap.locateType.addressToLotParcel,
lot: 100231,
parcel: 60,
gushSuffix: 12
}
govmap.searchAndLocate(params).then(function(response){
console.log(response);
});
}
</script>
</head>
<body>
<div id="map" style="width:600px;height:600px;"></div>
<button onClick="showExample()">גוש שלא מכיל תת-גוש</button>
<button onClick="showExample2()">גוש שמכיל תת-גוש: ללא תת-גוש בפרמטרים</button>
<button onClick="showExample3()">גוש שמכיל תת-גוש: עם תת-גוש בפרמטרים</button>
</body>
</html>

תוצאות חיפוש גוש חלקה לכתובת:​

{
"active": false,
"data": [
{
"ObjectId": 1,
"Values": [
"עין גדי",
"אילת",
28
],
"settlementCode": 2600,
"streetCode": 634
},
{
"ObjectId": 697,
"Values": [
"עין גדי",
"אילת",
32
],
"settlementCode": 2600,
"streetCode": 634
},
...
],
"errorCode": 0,
"message": null,
"status": 0
}

תוצאות חיפוש גוש (עם תת-גוש) חלקה לכתובת ללא תת-גוש:​

{
"active": false,
"data": [
12,
9,
11,
3
],
"errorCode": 0,
"message": "בגוש זה קיימים תתי-גושים, ראה רשימה",
"status": 1
}

תוצאות חיפוש גוש (עם תת-גוש) חלקה לכתובת עם תת-גוש:​

{
"active": false,
"data": [
{
"ObjectId": 449668,
"Values": [
"אל-מחבה",
"רהט",
58
],
"settlementCode": 1161,
"streetCode": 164
},
...
],
"errorCode": 0,
"message": null,
"status": 0
}