ritij srivastava
ritij srivastava

Reputation: 11

autofill search box here maps restrict country to United Kingdom using here maps api

How to limit here map search box to restrict to Country to United Kingdom or to cities within UK only.

here is my code:-

nokia.Settings.set("app_id", "DemoAppId01082013GAL"); nokia.Settings.set("app_code", "AJKnXv84fjrb0KIHawS0Tg"); // Use staging environment (remove the line for production environment) nokia.Settings.set("serviceMode", "cit"); var basicSearchBox = new nokia.places.widgets.SearchBox({ targetNode: "basicSearchBox", searchCenter: function () { return { latitude: 51.50642, longitude: -0.12721 }; }, onResults: function (data) { var result; var resultsElt = document.getElementById("basicSearchBox"); for (var i = 0, len = data.results.items.length; i

Upvotes: 1

Views: 1414

Answers (1)

Jithin Krishnan
Jithin Krishnan

Reputation: 1044

JS API 2.x is phased out, it is highly recommended to migrate to 3.x

In equivalent search box does not have a Country filter https://developer.here.com/api-explorer/maps-js/servicesPlaces/search-for-places

Maybe you can use Geocoder which does support country filter https://developer.here.com/api-explorer/maps-js/servicesRouting/geocode-a-location-from-address

https://developer.here.com/rest-apis/documentation/geocoder/topics/resource-geocode.html

Upvotes: 1

Related Questions