This document provides an overview of location technologies and services. It discusses how location data is obtained from GPS, cellular networks, and WiFi signals. It also introduces APIs from HERE Technologies for geocoding, reverse geocoding, maps, places, routing, and isoline routing. Examples are given using HERE's APIs to display maps, find addresses, search for points of interest, and calculate routes and isolines. The document concludes by discussing future location-based technologies and services.
30. Example: HERE Interactive Maps API
var platform = new H.service.Platform({
app_id: ’1234567890',
app_code: abcdefghi',
useHTTPS: true
});
var defaultLayers = platform.createDefaultLayers();
var map = new H.Map(document.getElementById('map'),
defaultLayers.normal.map);
var behavior = new H.mapevents.Behavior(new
H.mapevents.MapEvents(map));
var ui = H.ui.UI.createDefault(map, defaultLayers);
37. Example: HERE Places API
// creates a Search entrypoint
var search = new H.places.Search(platform.getPlacesService());
// creates parameters for search request
var params = {
'q': 'starbucks',
'at': '37.3720,-121.9221'
};
// creates a request with callbacks
search.request(params, {}, onResult, onError);
function onResult(result) {}
function onError(error) {}
38. Example: HERE Interactive Maps API
var group = new H.map.Group();
group.addObjects(places.map(function (place) {
var marker = new H.map.Marker({lat: place.position[0],
lng: place.position[1]})
return marker;
}));
map.addObject(group);
map.setViewBounds(group.getBounds());