You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See this email thread:
https://groups.google.com/forum/?hl=en#!topic/geoext-viewer-devel/_6aTZmerRMo
This is the initial request from Eddy:
".. wondering if it is possible to apply some kind of filter to the results of
the Nominatim request, in order to just display street, housenumber and
postalcode in the result.
http://open.mapquestapi.com/nominatim/v1/search?format=json&q="Unter den
Linden"&addressdetails=1&countrycodes=de&bounded=1&viewboxlbrt=13.08820,52.341,1
3.76,52.67&
This request results in very long string which contains information about
village, city, country and even continent. Doesn't really make sense for me,
because my application is just for one city.....
Maybe one of you guys has alredy stumbled upon a hint that'll do the trick :-)"
Indeed the current Heron.widgets.search.NominatimSearchCombo does not allow
custom display of search results. The cause is that these three aspects need to
work in cooperation:
1- the search URL parameters: see
http://open.mapquestapi.com/nominatim/#search. "addressdetails" need to be
provided to get formatted adresses
2- the combo Store: should be configured to contain addressdetails. Not just
"display_name".
3- formatting both the dropdown list and final result: an Ext.XTemplate can be
provided for "tpl" config, but this is only for the dropdownlist
The first two are easy to provide within the default
Heron.widgets.search.NominatimSearchCombo via
the "url" property and a new "storeFields" property. The third requires also a
new "displayTpl" property to provide an Ext template for displaying the result.
If all templates are set to null, the old behaviour (using "display_name" will
be used.
Actually work has already begun since this will make the
Heron.widgets.search.NominatimSearchCombo much more usable! See attached
screenshots for the following config:
{
type: "namesearch",
// Optional options, see NominatimSearchCombo.js, here we restrict search to The Netherlands.
options : {
url: 'http://open.mapquestapi.com/nominatim/v1/search?countrycodes=NL&addressdetails=1&format=json&limit=3',
xtype : 'hr_nominatimsearchcombo',
emptyText: __('Search Nominatim') + ' Netherlands',
tpl: '<tpl for="."><tpl for="address"><div class="x-combo-list-item">{road} {city} {state} {postcode} {country}</div></tpl></tpl>',
displayTpl: '<tpl for="."><tpl for="address">{road} {city} {state} {country}</tpl></tpl>'
}
}
Original issue reported on code.google.com by jus...@gmail.com on 24 Nov 2013 at 2:02
Original issue reported on code.google.com by
jus...@gmail.com
on 24 Nov 2013 at 2:02Attachments:
The text was updated successfully, but these errors were encountered: