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