Skip to content

Commit 758b338

Browse files
committed
Include address details for Nominatim
1 parent fc9028a commit 758b338

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Control.Geocoder.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@
264264
L.Control.Geocoder.jsonp(this.options.serviceUrl + 'search/', L.extend({
265265
q: query,
266266
limit: 5,
267-
format: 'json'
267+
format: 'json',
268+
addressdetails: 1
268269
}, this.options.geocodingQueryParams),
269270
function(data) {
270271
var results = [];
@@ -275,7 +276,8 @@
275276
icon: data[i].icon,
276277
name: data[i].display_name,
277278
bbox: L.latLngBounds([bbox[0], bbox[2]], [bbox[1], bbox[3]]),
278-
center: L.latLng(data[i].lat, data[i].lon)
279+
center: L.latLng(data[i].lat, data[i].lon),
280+
properties: data[i]
279281
};
280282
}
281283
cb.call(context, results);
@@ -287,6 +289,7 @@
287289
lat: location.lat,
288290
lon: location.lng,
289291
zoom: Math.round(Math.log(scale / 256) / Math.log(2)),
292+
addressdetails: 1,
290293
format: 'json'
291294
}, this.options.reverseQueryParams), function(data) {
292295
var result = [],
@@ -297,7 +300,8 @@
297300
result.push({
298301
name: data.display_name,
299302
center: loc,
300-
bounds: L.latLngBounds(loc, loc)
303+
bounds: L.latLngBounds(loc, loc),
304+
properties: data
301305
});
302306
}
303307

0 commit comments

Comments
 (0)