Skip to content

Instantly share code, notes, and snippets.

View here-devblog-gists's full-sized avatar

here-devblog-gists

  • HERE Technologies
View GitHub Profile
<script type="text/javascript" charset="UTF-8"
src="https://js.api.here.com/v3/3.0/mapsjs-mapevents.js"></script>
var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));
map.addEventListener('tap', function (evt) {
alert('Clicked at ' + evt.currentPointer.viewportX + ',' +
evt.currentPointer.viewportY);
});
function setUpClickListener(map) {
map.addEventListener('tap', function (evt) {
var coord = map.screenToGeo(evt.currentPointer.viewportX,
evt.currentPointer.viewportY);
alert('Clicked at ' + Math.abs(coord.lat.toFixed(4)) +
((coord.lat > 0) ? 'N' : 'S') +
' ' + Math.abs(coord.lng.toFixed(4)) +
((coord.lng > 0) ? 'E' : 'W'));
});
}
https://places.cit.api.here.com/places/v1/discover/search
?at=-22.9055,-43.1822
&q=library
&app_id={YOUR_APP_CODE}
&app_code={YOUR_APP_ID}
https://places.api.here.com/places/v1/discover/search
?at=-22.9055,-43.1822
&q=library
&app_id={YOUR_APP_CODE}
&app_code={YOUR_APP_ID}
var platform = new H.service.Platform({
app_id: 'DemoAppId01082013GAL',
app_code: 'AJKnXv84fjrb0KIHawS0Tg',
useHTTPS: true,
useCIT: true
});
https://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.xml
?app_id={APP_ID}
&app_code={APP_CODE}
&prox=51.503208,-0.12758
&mode=retrieveAddresses
&gen=9
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Leaflet Test</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
<style>
html,body,#map {
height: 100%
L.tileLayer('http://{s}.{base}.maps.cit.api.here.com/maptile/2.1/{type}/{mapID}/{scheme}/{z}/{x}/{y}/{size}/{format}?app_id={app_id}&app_code={app_code}&lg={language}', {
attribution: 'Map &copy; 2016 <a href="http://developer.here.com">HERE</a>',
subdomains: '1234',
base: 'base',
type: 'maptile',
scheme: 'pedestrian.day',
app_id: '{app_id}',
app_code: '{app_code}',
mapID: 'newest',
maxZoom: 20,