get latlong of address in here map api javascript

Solutions on MaxInterview for get latlong of address in here map api javascript by the best coders in the world

showing results for - "get latlong of address in here map api javascript"
Clara
04 Jan 2021
1// Instantiate a map and platform object:
2var platform = new H.service.Platform({
3  'apikey': '{YOUR_API_KEY}'
4});
5
6// Get an instance of the geocoding service:
7var service = platform.getSearchService();
8
9// Call the geocode method with the geocoding parameters,
10// the callback and an error callback function (called if a
11// communication error occurs):
12service.geocode({
13  q: '200 S Mathilda Ave, Sunnyvale, CA'
14}, (result) => {
15  // Add a marker for each location found
16  result.items.forEach((item) => {
17    map.addObject(new H.map.Marker(item.position));
18  });
19}, alert);
20