Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TECHDOCS-334-language-support #127

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e03484a
TECHDOCS-534: update multi-language support
ngross71 Oct 12, 2021
3b5d389
TECHDOCS-534: update multi-language support
ngross71 Oct 13, 2021
4bab9fc
TECHDOCS-1157 add instructions on how to run examples
ngross71 May 11, 2022
2c2b9b6
TECHDOCS-1157 add instructions on how to run examples
ngross71 May 13, 2022
c729e87
Merge pull request #1 from ngross71/TECHDOCS-1157-add-instructions-ex…
ngross71 May 17, 2022
6c4355d
Create main.yml
ngross71 Jul 7, 2022
c1c2561
add pipeline
ngross71 Jul 7, 2022
f064c8d
add pipeline
ngross71 Jul 7, 2022
0c36b5d
add pipeline
ngross71 Jul 7, 2022
4440dbf
add pipeline
ngross71 Jul 7, 2022
f54e483
add pipeline
ngross71 Jul 7, 2022
a5f75e7
add pipeline
ngross71 Jul 7, 2022
54e25ed
add pipeline
ngross71 Jul 7, 2022
fd43d22
add pipeline
ngross71 Jul 7, 2022
8465654
add pipeline
ngross71 Jul 7, 2022
0a844c4
add pipeline
ngross71 Jul 7, 2022
625302f
add pipeline
ngross71 Jul 8, 2022
6f6c3fd
add pipeline
ngross71 Jul 8, 2022
18c09e3
add pipeline
ngross71 Jul 12, 2022
6791968
add pipeline
ngross71 Jul 13, 2022
9743156
add pipeline
ngross71 Jul 13, 2022
1824f23
add pipeline
ngross71 Jul 13, 2022
ec70916
add pipeline
ngross71 Jul 13, 2022
3377f18
add pipeline
ngross71 Jul 14, 2022
817cf9b
add pipeline
ngross71 Jul 14, 2022
ee05db7
add pipeline
ngross71 Jul 19, 2022
5da0153
add pipeline
ngross71 Jul 19, 2022
cb8f323
add pipeline
ngross71 Jul 19, 2022
9d97528
add pipeline
ngross71 Jul 19, 2022
c7a0411
add pipeline
ngross71 Jul 19, 2022
ff63756
add pipeline
ngross71 Jul 19, 2022
89fcda3
add pipeline
ngross71 Jul 19, 2022
4c88f3d
add pipeline
ngross71 Jul 19, 2022
7313cb2
add pipeline
ngross71 Jul 19, 2022
f496d4c
add pipeline
ngross71 Jul 19, 2022
72a534e
add pipeline
ngross71 Jul 19, 2022
aff7826
install jsdom
ngross71 Jul 25, 2022
320b44e
install jsdom
ngross71 Jul 25, 2022
2b9df5b
install jsdom
ngross71 Jul 25, 2022
ac6e2c0
install jsdom
ngross71 Jul 25, 2022
a19bad6
install jsdom
ngross71 Jul 25, 2022
ae0b377
install jsdom
ngross71 Jul 25, 2022
4594739
install jsdom
ngross71 Jul 25, 2022
e587b51
install jsdom
ngross71 Jul 25, 2022
d9607ba
install jsdom
ngross71 Jul 25, 2022
38bfd3d
install jsdom
ngross71 Jul 25, 2022
1733c9f
install jsdom
ngross71 Jul 25, 2022
3883d50
install jsdom
ngross71 Jul 25, 2022
9e0c568
install jsdom
ngross71 Jul 25, 2022
c338b7d
install jsdom
ngross71 Jul 25, 2022
c99989c
install jsdom
ngross71 Jul 25, 2022
8931944
install jsdom
ngross71 Jul 25, 2022
7103b9c
install jsdom
ngross71 Jul 25, 2022
3e57533
install jsdom
ngross71 Jul 25, 2022
ee74f3e
install jsdom
ngross71 Jul 25, 2022
912e864
install jsdom
ngross71 Jul 25, 2022
3d94524
install jsdom
ngross71 Jul 26, 2022
cba36e6
install jsdom
ngross71 Jul 26, 2022
6579f82
install jsdom
ngross71 Jul 26, 2022
3acbb6c
install jsdom
ngross71 Jul 26, 2022
7f9b464
install jsdom
ngross71 Jul 26, 2022
cbb160a
install jsdom
ngross71 Jul 26, 2022
69727d9
install jsdom
ngross71 Aug 1, 2022
5d824dd
install jsdom
ngross71 Aug 1, 2022
68f55a6
install jsdom
ngross71 Aug 1, 2022
f88a076
install jsdom
ngross71 Aug 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .github/workflows/install-jsdom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// const { JSDOM } = node-jsdom;


// const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);
// console.log(dom.window.document.querySelector("p").textContent); // "Hello world"
const jsdom = require("jsdom");
const { JSDOM } = jsdom;

console.log("Hello world");
56 changes: 56 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This is a basic workflow to help you get started with Actions

name: CI


# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Runs a single command using the runners shell
- name: Run a one-line script
run: echo Hello, world!

# Runs a set of commands using the runners shell
- name: Run a multi-line script
run: |
git clone https://github.com/jsdom/jsdom.git
npm i jsdom
chmod u+x ./.github/workflows/install-jsdom.js
node ./.github/workflows/install-jsdom.js


- name: Upload the build output
uses: actions/upload-artifact@v2
with:
path: output/

log:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: log
run: cat /home/runner/.npm/_logs/2022-07-26T07_43_50_273Z-debug-0.log
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 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 [developer.here.com](https://developer.here.com/develop/javascript-api) under the JavaScript APIs section.
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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid giving direct instructions on where to clone the repo.
Therefore I would rephrase this like so:

Suggested change
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.
To run the examples, clone this repo and 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.

Expand All @@ -22,7 +23,6 @@ All of the following examples use **version 3.1** of the API
* [Display KML Data](https://heremaps.github.io/maps-api-for-javascript-examples/display-kml-on-map/demo.html) - Parse a KML file and display the data on a map
* [Display GeoJSON Data](https://heremaps.github.io/maps-api-for-javascript-examples/display-geojson-on-map/demo.html) - Parse a GeoJSON file and display the data on a map
* [Display an Indoor Map](https://heremaps.github.io/maps-api-for-javascript-examples/indoor-map/demo.html) - Use the HERE Indoor Maps API to load and visualize an indoor map
* [Display routing on an Indoor Map](https://heremaps.github.io/maps-api-for-javascript-examples/indoor-map-routing/demo.html) - Use the HERE Indoor Maps API to calculate an indoor-outdoor route
* [Draggable Marker](https://heremaps.github.io/maps-api-for-javascript-examples/draggable-marker/demo.html) - Display a moveable marker on a map
* [Draggable geo shapes](https://heremaps.github.io/maps-api-for-javascript-examples/draggable-shapes/demo.html) - Display moveable geometric shapes on a map
* [Extruded geo shapes](https://heremaps.github.io/maps-api-for-javascript-examples/extruded-objects/demo.html) - 3D extrusion of the geometric shapes
Expand Down
2 changes: 1 addition & 1 deletion interactive-basemap/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<h1>Interactive base map</h1>
<p>Retrieve information associated with the map features</p>
</div>
<p>This example demonstrates how to enable the interactions with the base map features. The interactions are enabled for the countries'
<p>This example demonstrates how to enable the interactions with the base map features. See <a href="https://github.com/heremaps/maps-api-for-javascript-examples">the README</a> for instructions on how to run the example.The interactions are enabled for the countries'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>This example demonstrates how to enable the interactions with the base map features. See <a href="https://github.com/heremaps/maps-api-for-javascript-examples">the README</a> for instructions on how to run the example.The interactions are enabled for the countries'
<p>This example demonstrates how to enable the interactions with the base map features. See <a href="https://github.com/heremaps/maps-api-for-javascript-examples#maps-api-for-javascript">the README</a> for instructions on how to run the example. The interactions are enabled for the countries'

What's the reason for adding this line only to this example?

cities', towns' and neighbourhoods' labels. When these labels are clicked the info bubble with the information about the label is shown.
</p>
<div id="map"></div>
Expand Down
4 changes: 3 additions & 1 deletion map-multi-language-support/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ <h3>Code</h3>
<p>A reference to the base map tile service is obtained using the <code>H.service.Platform</code>.
Alternate languages can be requested by adding the <code>lg</code> parameter to the tile requests.
That is done by calling createTileLayer method. 5th argument is list of key/value parameters which are
passed to the map tile service when requesting each tile. List of all supported map languages can be found in the API References of the underlying service you are using.</p>
passed to the map tile service when requesting each tile.
A list of all supported map languages can be found in the API References of the underlying service used: <a href="https://developer.here.com/documentation/map-tile/dev_guide/topics/resource-base-maptile.html">HERE Map Tile API</a>
and <a href="https://developer.here.com/documentation/vector-tiles-api/dev_guide/topics/languages.html">HERE Vector Tile API</a> </p>
<p>It is possible to specify map language for all layers at once when using <code>H.service.Platform.createDefaultLayers</code> method.</p>
<p>Language of the UI controls can be specified when calling <code>H.ui.UI.createDefault</code> method.
3rd argument is either a supported language code or a custom <code>H.ui.i18n.Localization object</code>.</p>
Expand Down
23 changes: 23 additions & 0 deletions maps-api-for-javascript-examples/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Unless otherwise noted in a LICENSE file for specific files or directories, the files in this repository are under the following license.

The MIT License (MIT)

Copyright (c) 2016 HERE Europe B.V.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
67 changes: 67 additions & 0 deletions maps-api-for-javascript-examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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.

> **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.

See the [LICENSE](LICENSE) file in the root of this project for license details.

## Maps API for JavaScript

All of the following examples use **version 3.1** of the API

* [Adding an Overlay to the Map](https://heremaps.github.io/maps-api-for-javascript-examples/custom-tile-overlay/demo.html) - Display custom map tiles as an overlay
* [Animated Markers](https://heremaps.github.io/maps-api-for-javascript-examples/markers-update-position-with-animation/demo.html) - Update marker position with animation
* [Calculating a Location from a Mouse Click](https://heremaps.github.io/maps-api-for-javascript-examples/position-on-mouse-click/demo.html) - Obtain the latitude and longitude of a location within the map
* [Changing from the Metric System](https://heremaps.github.io/maps-api-for-javascript-examples/map-scale-bar-changing-from-the-metric-system/demo.html) - Display a map including a scale bar in miles or yards
* [Circle on the Map](https://heremaps.github.io/maps-api-for-javascript-examples/circle-on-the-map/demo.html) - Display a map highlighting a circular region
* [DOM Marker](https://heremaps.github.io/maps-api-for-javascript-examples/map-with-dom-marker/demo.html) - Display a marker that is capable of receiving DOM events
* [DOM Marker rotation](https://heremaps.github.io/maps-api-for-javascript-examples/dom-marker-rotation/demo.html) - Rotate DOM Marker's content using CSS
* [Display KML Data](https://heremaps.github.io/maps-api-for-javascript-examples/display-kml-on-map/demo.html) - Parse a KML file and display the data on a map
* [Display GeoJSON Data](https://heremaps.github.io/maps-api-for-javascript-examples/display-geojson-on-map/demo.html) - Parse a GeoJSON file and display the data on a map
* [Display an Indoor Map](https://heremaps.github.io/maps-api-for-javascript-examples/indoor-map/demo.html) - Use the HERE Indoor Maps API to load and visualize an indoor map
* [Display routing on an Indoor Map](https://heremaps.github.io/maps-api-for-javascript-examples/indoor-map-routing/demo.html) - Use the HERE Indoor Maps API to calculate an indoor-outdoor route
* [Draggable Marker](https://heremaps.github.io/maps-api-for-javascript-examples/draggable-marker/demo.html) - Display a moveable marker on a map
* [Draggable geo shapes](https://heremaps.github.io/maps-api-for-javascript-examples/draggable-shapes/demo.html) - Display moveable geometric shapes on a map
* [Extruded geo shapes](https://heremaps.github.io/maps-api-for-javascript-examples/extruded-objects/demo.html) - 3D extrusion of the geometric shapes
* [Finding the Nearest Marker](https://heremaps.github.io/maps-api-for-javascript-examples/finding-the-nearest-marker/demo.html) - Find a marker nearest to the click location
* [Image overlay](https://heremaps.github.io/maps-api-for-javascript-examples/image-overlay/demo.html) - Display an animated weather radar
* [Interactive Map Layer](https://heremaps.github.io/maps-api-for-javascript-examples/transit-mapsjs-iml/demo.html) - Visualize Data from Interactive Map Layer on Map
* [Interleave vector and object layers](https://heremaps.github.io/maps-api-for-javascript-examples/interleave-layers/demo.html) - Display an object under the buildings
* [Map Objects Event Delegation](https://heremaps.github.io/maps-api-for-javascript-examples/map-objects-event-delegation/demo.html) - Use event delegation on map objects
* [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 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.
* [Map with isoline route](https://heremaps.github.io/maps-api-for-javascript-examples/map-with-isoline-route/demo.html) - Request a range for the EV vehicle.
* [Marker Clustering](https://heremaps.github.io/maps-api-for-javascript-examples/marker-clustering/demo.html) - Cluster multiple markers together to better visualize the data
* [Marker Clustering with Custom Theme](https://heremaps.github.io/maps-api-for-javascript-examples/custom-cluster-theme/demo.html) - Cluster multiple markers and customize the theme
* [Marker on the Map](https://heremaps.github.io/maps-api-for-javascript-examples/markers-on-the-map/demo.html) - Display a map highlighting points of interest
* [Markers with Altitude](https://heremaps.github.io/maps-api-for-javascript-examples/markers-with-altitude/demo.html) - Display markers at different altitudes
* [Multi-language support](https://heremaps.github.io/maps-api-for-javascript-examples/map-multi-language-support/demo.html) - Display a map with labels in a foreign language
* [Opening an Infobubble on a Mouse Click](https://heremaps.github.io/maps-api-for-javascript-examples/open-infobubble/demo.html) - Open an infobubble when a marker is clicked
* [Ordering Overlapping Markers](https://heremaps.github.io/maps-api-for-javascript-examples/ordering-overlapping-markers/demo.html) - Arrange the order in which a series of map objects are displayed
* [Panning the Map](https://heremaps.github.io/maps-api-for-javascript-examples/panning-the-map/demo.html) - Programmatically pan the map so that it is continually in motion
* [Polygon on the Map](https://heremaps.github.io/maps-api-for-javascript-examples/polygon-on-the-map/demo.html) - Display a map highlighting a region or area
* [Polyline on the Map](https://heremaps.github.io/maps-api-for-javascript-examples/polyline-on-the-map/demo.html) - Display a map with a line showing a known route
* [Rectangle on the map](https://heremaps.github.io/maps-api-for-javascript-examples/rectangle-on-the-map/demo.html) - Display a map highlighting a retangular region or area
* [Resizable geo Polygon](https://heremaps.github.io/maps-api-for-javascript-examples/resizable-polygon/demo.html) - Display resizable polygon on a map
* [Resizable geo Polyline](https://heremaps.github.io/maps-api-for-javascript-examples/resizable-polyline/demo.html) - Display resizable polyline on a map
* [Resizable geo Circle](https://heremaps.github.io/maps-api-for-javascript-examples/resizable-circle/demo.html) - Display resizable circle on a map
* [Resizable geo Rect](https://heremaps.github.io/maps-api-for-javascript-examples/resizable-rect/demo.html) - Display resizable rectangle on a map
* [Restrict Map Movement](https://heremaps.github.io/maps-api-for-javascript-examples/restrict-map/demo.html) - Restrict a moveable map to a given rectangular area
* [SVG Graphic Markers](https://heremaps.github.io/maps-api-for-javascript-examples/map-with-svg-graphic-markers/demo.html) - Display a map with custom SVG markers
* [Search for a Landmark](https://heremaps.github.io/maps-api-for-javascript-examples/search-for-landmark/demo.html) - Request the location of a landmark and display it on the map.
* [Search for a Location based on an Address](https://heremaps.github.io/maps-api-for-javascript-examples/geocode-a-location-from-address/demo.html) - Request a location using a free-form text input and display it on the map.
* [Search for a Location given a Structured Address](https://heremaps.github.io/maps-api-for-javascript-examples/geocode-a-location-from-structured-address/demo.html) - Request a location from a structured address and display it on the map.
* [Search for the Address of a Known Location](https://heremaps.github.io/maps-api-for-javascript-examples/reverse-geocode-an-address-from-location/demo.html) - Request address details for a given location and display it on the map.
* [Set a map style at the load time](https://heremaps.github.io/maps-api-for-javascript-examples/change-style-at-load/demo.html) - Set a style of the whole map during the map instantiation
* [Synchronising Two Maps](https://heremaps.github.io/maps-api-for-javascript-examples/synchronising-two-maps/demo.html) - Synchronise a static map with an interactive map
* [Take a Snapshot of the Map](https://heremaps.github.io/maps-api-for-javascript-examples/capture-map-area/demo.html) - Capture an area on the map
* [Truck routing road restrictions](https://heremaps.github.io/maps-api-for-javascript-examples/truck-routing-road-restrictions/demo.html) Show a various truck routes with the truck related road restrictions highlighted on the map
* [Zoom into Bounds](https://heremaps.github.io/maps-api-for-javascript-examples/custom-zooming-into-bounds/demo.html) - Zoom into bounds limiting maximum level
* [Zooming to a Set of Markers](https://heremaps.github.io/maps-api-for-javascript-examples/zoom-to-set-of-markers/demo.html) - Alter the viewport to ensure a group of objects are visible
24 changes: 24 additions & 0 deletions maps-api-for-javascript-examples/capture-map-area/demo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#map {
width: 95%;
height: 450px;
background: grey;
}

#panel {
width: 100%;
height: 160px;
}

.btn-group {
position: absolute;
top: 11rem;
left: 0.2rem;
background-color: #fff;
padding: 10px;
}

@media (max-width: 1024px ) {
.btn-group {
top: 15rem;
}
}
12 changes: 12 additions & 0 deletions maps-api-for-javascript-examples/capture-map-area/demo.details
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Take a Snapshot of the Map
description: Capture an area on the map
resources:
- https://heremaps.github.io/maps-api-for-javascript-examples/test-credentials.js
normalize_css: no
dtd: html 5
wrap: d
panel_html: 0
panel_js: 0
panel_css: 0
...
Loading