Skip to content

Commit

Permalink
Merge branch 'master' into indoor-example-updated-mapId-to-UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
iamravisingh authored Oct 29, 2024
2 parents 4be4ff5 + 2cc74e8 commit 57cb731
Show file tree
Hide file tree
Showing 45 changed files with 9,844 additions and 257 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Maps API for JavaScript

This repository holds a series of JavaScript based examples using the **HERE Maps API for JavaScript**. More information about the API can be found on [developer.here.com](https://developer.here.com/develop/javascript-api) under the JavaScript APIs section.
This repository holds a series of JavaScript based examples using the **HERE Maps API for JavaScript**. More information about the API can be found on [https://here.com/docs](https://www.here.com/docs/category/here-sdk-for-js) website.
To run the examples, clone this repo to a folder on your Desktop. Replace the credentials in the **test-credentials.js** file with your own credentials.

> **Note:** In order to get the sample code to work, you **must** replace all instances of `window.apikey` within the code and use your own **HERE** credentials.
> You can obtain a set of credentials from the [Plans Page](https://developer.here.com/plans) on developer.here.com.
> You can obtain a set of credentials from the [HERE Base Plan Pricing](https://here.com/get-started/pricing) page on here.com.
See the [LICENSE](LICENSE) file in the root of this project for license details.

Expand Down Expand Up @@ -36,6 +36,7 @@ All of the following examples use **version 3.1** of the API
* [Map Objects Events](https://heremaps.github.io/maps-api-for-javascript-examples/map-object-events-displayed/demo.html) - Handle events on various map objects
* [Map at a specified location](https://heremaps.github.io/maps-api-for-javascript-examples/map-at-specified-location/demo.html) - Display a map at a specified location and zoom level
* [Map using View Bounds](https://heremaps.github.io/maps-api-for-javascript-examples/map-using-view-bounds/demo.html) - Display a map of a given area
* [Map with custom MapSettings UI Control](https://heremaps.github.io/maps-api-for-javascript-examples/map-with-custom-map-settings-ui-control/demo.html) - Switch between different layers using a custom MapSettings UI control.
* [Map with Driving Route from A to B](https://heremaps.github.io/maps-api-for-javascript-examples/map-with-route-from-a-to-b/demo.html) - Request a driving route from A to B and display it on the map.
* [Map with Pedestrian Route from A to B](https://heremaps.github.io/maps-api-for-javascript-examples/map-with-pedestrian-route-from-a-to-b/demo.html) - Request a walking route from A to B and display it on the map.
* [Map with Route from A to B using Public Transport](https://heremaps.github.io/maps-api-for-javascript-examples/map-with-route-from-a-to-b-using-public-transport/demo.html) - Request a route from A to B using public transport and display it on the map.
Expand Down
2 changes: 1 addition & 1 deletion custom-tile-overlay/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2>Credits</h2>
</p>
<h3>Code</h3>
<p>
The example uses the <a target="_blank" rel="nofollow" href="http://developer.here.com/javascript-apis/documentation/v3/maps/topics_api_nlp/h-map-provider-imagetileprovider.html"><code>H.map.provider.ImageTileProvider</code></a> class for fetching our custom tiles. The <code>getUrl()</code> method constructs the URL of the tile for the specified column/row/zoom position. The result is displayed on the map as an additional layer using an instance of the <a target="_blank" rel="nofollow" href="http://developer.here.com/javascript-apis/documentation/v3/maps/topics_api_nlp/h-map-layer-layer.html"><code>H.map.layer.TileLayer</code></a> class which has been created by passing in the image tile provider object.
The example uses the <a target="_blank" rel="nofollow" href="https://www.here.com/docs/bundle/maps-api-for-javascript-api-reference/page/H.map.provider.ImageTileProvider.html"><code>H.map.provider.ImageTileProvider</code></a> class for fetching our custom tiles. The <code>getUrl()</code> method constructs the URL of the tile for the specified column/row/zoom position. The result is displayed on the map as an additional layer using an instance of the <a target="_blank" rel="nofollow" href="https://www.here.com/docs/bundle/maps-api-for-javascript-api-reference/page/H.map.layer.TileLayer.html"><code>H.map.layer.TileLayer</code></a> class which has been created by passing in the image tile provider object.
</p>
<script type="text/javascript" src='demo.js'></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion display-geojson-on-map/demo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function showGeoJSONData (map) {
// Create GeoJSON reader which will download the specified file.
// Shape of the file was obtained by using HERE Geocoder API.
// Shape of the file was obtained by using HERE Geocoding and Search API.
// It is possible to customize look and feel of the objects.
var reader = new H.data.geojson.Reader('data/berlin.json', {
// This function is called each time parser detects a new map object
Expand Down
6 changes: 3 additions & 3 deletions display-kml-on-map/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-data.js"></script>
<link rel="stylesheet" type="text/css" href="../template.css" />
<link rel="stylesheet" type="text/css" href="demo.css" />
<script type="text/javascript" src='../test-credentials.js'></script>
<script type="text/javascript" src='../test-credentials.js'></script>
<style type="text/css">
.log {
position: absolute;
Expand All @@ -39,10 +39,10 @@
</head>
<body>
<h1>Display KML Data</h1>
<p>This example shows a map of the <b>United States</b> from the <a href="https://www.census.gov">U.S. Census Bureau</a>, highlighting the borders of each state.
<p>This example shows a map of the <b>United States</b> from the <a href="https://www.census.gov" target="_blank">U.S. Census Bureau</a>, highlighting the borders of each state.
The data to display on the map has been read in from a KML file and loaded using the built-in KML parser.</p>
<p>The name of the state is logged when the user taps on the state's shape</p>
<div id="map"></div>
<script type="text/javascript" src='demo.js'></script>
</body>
</html>
</html>
78 changes: 0 additions & 78 deletions example-template/demo.js

This file was deleted.

1 change: 0 additions & 1 deletion example-template/styles.css

This file was deleted.

12 changes: 6 additions & 6 deletions geocode-a-location-from-address/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="stylesheet" type="text/css" href="demo.css" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" type="text/css" href="../template.css" />
<script type="text/javascript" src='../test-credentials.js'></script>
<script type="text/javascript" src='../test-credentials.js'></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-core.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-service.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-ui.js"></script>
Expand All @@ -19,16 +19,16 @@
<h1>Search for a Location based on an Address</h1>
<p>Request a location using a free-form text input and display it on the map.</p>
</div>
<p>This example makes a geocoding request and retrieves the latitude, longitude and
complete address details of <b>200 S Mathilda Ave, Sunnyvale, CA</b> based on a free-form
<p>This example makes a geocoding request and retrieves the latitude, longitude and
complete address details of <b>200 S Mathilda Ave, Sunnyvale, CA</b> based on a free-form
text input. A clickable marker is placed on the location found.</p>
<div id="map"></div>
<div id="panel"></div>
<h3>Code</h3>
<p>Access to the geocoding service is obtained from the <code>H.service.Platform</code>
by calling <code>getSearchService()</code>. The <code>geocode()</code> method is used
to find a location by passing in the relevant <code>q</code> parameter as defined in
<a href="https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-geocode-brief.html" target="_blank">Geocoding and Search API v7</a>.
by calling <code>getSearchService()</code>. The <code>geocode()</code> method is used
to find a location by passing in the relevant <code>q</code> parameter as defined in
<a href="https://www.here.com/docs/bundle/geocoding-and-search-api-v7-api-reference/page/index.html#/paths/~1geocode/get" target="_blank">Geocoding and Search API v7</a>.
The styling and display of the response is under the control of the developer.</p>
<script type="text/javascript" src='demo.js'></script>
</body>
Expand Down
7 changes: 3 additions & 4 deletions geocode-a-location-from-address/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
*
* A full list of available request parameters can be found in the Geocoder API documentation.
* see: http://developer.here.com/rest-apis/documentation/geocoder/topics/resource-geocode.html
* see: https://www.here.com/docs/bundle/geocoding-and-search-api-v7-api-reference/page/index.html#/paths/~1geocode/get
*
* @param {H.service.Platform} platform A stub class to access HERE services
*/
Expand All @@ -22,9 +22,8 @@ function geocode(platform) {
}
/**
* This function will be called once the Geocoder REST API provides a response
* @param {Object} result A JSONP object representing the location(s) found.
*
* see: http://developer.here.com/rest-apis/documentation/geocoder/topics/resource-type-response-geocode.html
* @param {Object} result A JSON object representing the location(s) found.
* See: https://www.here.com/docs/bundle/geocoding-and-search-api-v7-api-reference/page/index.html#/paths/~1geocode/get
*/
function onSuccess(result) {
var locations = result.items;
Expand Down
16 changes: 8 additions & 8 deletions geocode-a-location-from-structured-address/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<link rel="stylesheet" type="text/css" href="demo.css" />
<link rel="stylesheet" type="text/css" href="styles.css" />
<link rel="stylesheet" type="text/css" href="../template.css" />
<script type="text/javascript" src='../test-credentials.js'></script>
<script type="text/javascript" src='../test-credentials.js'></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-core.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-service.js"></script>
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-ui.js"></script>
Expand All @@ -19,18 +19,18 @@
<h1>Search for a Location given a Structured Address</h1>
<p>Request a location from a structured address and display it on the map.</p>
</div>
<p>This example makes a geocode request and retrieves the latitude, longitude and complete address details of
<b>425 Randolph St, Chicago, IL</b> based on partial address information. Two addresses are found -
<p>This example makes a geocode request and retrieves the latitude, longitude and complete address details of
<b>425 Randolph St, Chicago, IL</b> based on partial address information. Two addresses are found -
<i>425 E Randolph St.</i>, and <i>425 W Randolph St.</i> A clickable marker is placed on each location found.</p>
<div id="map"></div>
<div id="panel"></div>
<h3>Code</h3>
<p>Access to the geocoding service is obtained from the <code>H.service.Platform</code>
by calling <code>getSearchService()</code>. The <code>geocode()</code> method is used
to find a location by passing in the relevant values to the <code>qq</code> parameter (i.e. <code>country</code>, <code>city</code>,
<code>street</code> and <code>housenumber</code>) as defined in
<a href="https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-geocode-brief.html" target="_blank">Geocoding and Search API v7
</a>.
by calling <code>getSearchService()</code>. The <code>geocode()</code> method is used
to find a location by passing in the relevant values to the <code>qq</code> parameter (i.e. <code>country</code>, <code>city</code>,
<code>street</code> and <code>housenumber</code>) as defined in
<a href="https://www.here.com/docs/bundle/geocoding-and-search-api-v7-api-reference/page/index.html#/paths/~1geocode/get" target="_blank">Geocoding and Search API v7
</a>.
The styling and display of the response is under the control of the developer.</p>
<script type="text/javascript" src='demo.js'></script>
</body>
Expand Down
9 changes: 4 additions & 5 deletions geocode-a-location-from-structured-address/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* based on a structured input
*
*
* A full list of available request parameters can be found in the Geocoder API documentation.
* see: http://developer.here.com/rest-apis/documentation/geocoder/topics/resource-geocode.html
* A full list of available request parameters can be found in the Geocoding and Search API documentation.
* see: https://www.here.com/docs/bundle/geocoding-and-search-api-v7-api-reference/page/index.html#/paths/~1geocode/get
*
* @param {H.service.Platform} platform A stub class to access HERE services
*/
Expand All @@ -22,9 +22,8 @@ function geocode(platform) {
}
/**
* This function will be called once the Geocoder REST API provides a response
* @param {Object} result A JSONP object representing the location(s) found.
*
* see: http://developer.here.com/rest-apis/documentation/geocoder/topics/resource-type-response-geocode.html
* @param {Object} result A JSON object representing the location(s) found.
* See: https://www.here.com/docs/bundle/geocoding-and-search-api-v7-api-reference/page/index.html#/paths/~1geocode/get
*/
function onSuccess(result) {
var locations = result.items;
Expand Down
6 changes: 3 additions & 3 deletions indoor-map-movement/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@
<body>
<h1>Indoor Map - Restrict map movement</h1>
<p>
More information on the use of the HERE Indoor Maps API is available <a href="https://developer.here.com/documentation/maps/dev_guide/topics/venues.html" target="_blank">here</a>.
More information on the use of the HERE Indoor Maps API is available <a href="https://www.here.com/docs/bundle/maps-api-for-javascript-developer-guide/page/topics/indoor-maps.html" target="_blank">here</a>.
</p>

<p>
This example shows an Indoor Map of the <b>Tiefgarage Riem Arcaden APCOA parking garage</b>.
This example also works with Mall of Berlin and Zurich Airport
</p>

<div id="map"></div>
<h3>Code</h3>
<p>
Expand Down
8 changes: 4 additions & 4 deletions indoor-map-ui-interaction/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@
<body>
<h1>Indoor Map UI Interactions</h1>
<p>
More information on the use of the HERE Indoor Maps API is available <a href="https://developer.here.com/documentation/maps/dev_guide/topics/venues.html" target="_blank">here</a>.
More information on the use of the HERE Indoor Maps API is available <a href="https://www.here.com/docs/bundle/maps-api-for-javascript-developer-guide/page/topics/indoor-maps.html" target="_blank">here</a>.
</p>

<p>
This example shows an Indoor Map of the <b>Mall of Berlin</b>.
This example also works with Tiefgarage Riem Arcaden APCOA parking garage and Zurich Airport
</p>

<div id="map"></div>
<h3>Code</h3>
<p>
The example shows UI interactions with the Indoor Map.<br>
The example shows UI interactions with the Indoor Map.<br>
The example covers the below mentioned samples:
<ul>
<li>the usage of the indoor map related UI controls to change levels and buildings using <code>H.venues.ui.LevelControl</code> and <code>H.venues.ui.DrawingControl</code> respectively.</li>
Expand Down
Loading

0 comments on commit 57cb731

Please sign in to comment.