# HEREMAP
A framework to simplify the use of HERE Maps, which a bunch of higher level functions.
In addition, it brings  geocoding and routing functions to Node.js

See examples in the demo directory, starting with demo/demo-basic.html.

Get your credentials at [http://developer.here.com](http://developer.here.com)

## Installation

1/ For use in Node.js, install the package:

npm install --save-dep heremap

To use in a js file

	const hm = require("heremap");

	hm.config({
		app_id: YOUR APP_ID,
		app_code: YOUR APP_CODE,
	});

	let res = await hm.geocode("avenue des champs elysees, paris);
	console.log(res.coord);


2/ For use in browser, add these lines in your html file

	<link rel="stylesheet" type="text/css" href="http://www.unpkg.com/heremap@2.2.6/css/heremap.css" />

	<script src="http://www.unpkg.com/heremap@2.2.6/dist/libhere.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="http://www.unpkg.com/heremap@2.2.6/dist/heremap.min.js" type="text/javascript" charset="utf-8"></script>

	<div id="map"></div>

Then in your JS script:

	const hm = window.heremap;

	hm.config({
		app_id: YOUR APP_ID,
		app_code: YOUR APP_CODE,
	});

	hm.map("map", {
		zoom:5,
		center: [48.8,2.3],
		click: function(coord,button,key) {console.log("clicked on",coord,"with button",button);}
	});


## Demo

See under directory [demo](demo):

- [demo-basic.html](demo/demo-basic.html): how to display a simple map in a web pgae
- [demo-cluster.html](demo/demo-cluster.html): how to cluster thousands of points on a map
- [demo-markers.html](demo/demo-markers.html): different kind of svg or png markers, with different size, anchor..
- [demo-screenshot.html](demo/demo-screenshot.html): how to do a screenshot of the map
- [demo-asia.html](demo/demo-asia.html): how to display high quality ap in Japan and Korea. (requires special credentials)
- [demo-autocomplete.html](demo/demo-autocomplete.html): autocomplete exemple
- [demo-touch.html](demo/demo-touch.html): draw a polyline on a touch screen
- [demo-nearcity.html](demo/demo-nearcity.html): find big cities around the mouse click
- [demo-locateme.html](demo/demo-locateme.html): display own location 
 


## Functions

<dl>
<dt><a href="#hm_PDEManager">hm:PDEManager(opt)</a></dt>
<dd><p>Manage PDE requests</p>
</dd>
<dt><a href="#hm_PDEManager">hm:PDEManager(opt)</a></dt>
<dd><p>Manage PDE requests</p>
</dd>
<dt><a href="#hm_bb2Poly">hm:bb2Poly(bb)</a> ⇒ <code>array</code></dt>
<dd><p>convert a bounding box into a list of five [lat,lng], last is same as first</p>
</dd>
<dt><a href="#hm_bb2Poly">hm:bb2Poly(bb)</a> ⇒ <code>array</code></dt>
<dd><p>convert a bounding box into a list of five [lat,lng], last is same as first</p>
</dd>
<dt><a href="#hm_bubbleUnique">hm:bubbleUnique(coord, txt)</a></dt>
<dd><p>Display a unique bubble. Associated CSS style is .H_ib_body</p>
</dd>
<dt><a href="#hm_bubbleUnique">hm:bubbleUnique(coord, txt)</a></dt>
<dd><p>Display a unique bubble. Associated CSS style is .H_ib_body</p>
</dd>
<dt><a href="#hm_bubbleUniqueHide">hm:bubbleUniqueHide()</a></dt>
<dd><p>hide a unique bubble</p>
</dd>
<dt><a href="#hm_bubbleUniqueHide">hm:bubbleUniqueHide()</a></dt>
<dd><p>hide a unique bubble</p>
</dd>
<dt><a href="#hm_buildIcon">hm:buildIcon(opt)</a> ⇒ <code>promise</code></dt>
<dd><p>create an icon, to be used for a marker</p>
</dd>
<dt><a href="#hm_buildIcon">hm:buildIcon(opt)</a> ⇒ <code>promise</code></dt>
<dd><p>create an icon, to be used for a marker</p>
</dd>
<dt><a href="#hm_circle">hm:circle(opt)</a></dt>
<dd><p>draw a circle</p>
</dd>
<dt><a href="#hm_circle">hm:circle(opt)</a></dt>
<dd><p>draw a circle</p>
</dd>
<dt><a href="#hm_cluster">hm:cluster(coords, opt, cb)</a> ⇒ <code>H.map.layer.ObjectLayer</code></dt>
<dd><p>Creates a cluster of points</p>
</dd>
<dt><a href="#hm_clusterHide">hm:clusterHide()</a></dt>
<dd><p>Hide cluster layer</p>
</dd>
<dt><a href="#hm_clusterShow">hm:clusterShow()</a></dt>
<dd><p>Show cluster layer</p>
</dd>
<dt><a href="#hm_config">hm:config(opt)</a></dt>
<dd><p>To configure app_id, app_code and optionally use CIT and http</p>
</dd>
<dt><a href="#hm_config">hm:config(opt)</a></dt>
<dd><p>To configure app_id, app_code and optionally use CIT and http</p>
</dd>
<dt><a href="#hm_coord2Point">hm:coord2Point(coord)</a> ⇒ <code>object</code></dt>
<dd><p>Convert [lat,lng] to {lat,lng}</p>
</dd>
<dt><a href="#hm_coord2Point">hm:coord2Point(coord)</a> ⇒ <code>object</code></dt>
<dd><p>Convert [lat,lng] to {lat,lng}</p>
</dd>
<dt><a href="#hm_coordA2O">hm:coordA2O(arr)</a> ⇒ <code>array</code></dt>
<dd><p>Convert an array [lat,lng] to {lat,lng}</p>
</dd>
<dt><a href="#hm_coordA2O">hm:coordA2O(arr)</a> ⇒ <code>array</code></dt>
<dd><p>Convert an array [lat,lng] to {lat,lng}</p>
</dd>
<dt><a href="#hm_coordO2A">hm:coordO2A(obj)</a> ⇒ <code>array</code></dt>
<dd><p>Convert an object {lat,lng} to [lat,lng]</p>
</dd>
<dt><a href="#hm_coordO2A">hm:coordO2A(obj)</a> ⇒ <code>array</code></dt>
<dd><p>Convert an object {lat,lng} to [lat,lng]</p>
</dd>
<dt><a href="#hm_coords2XY">hm:coords2XY(coords)</a> ⇒ <code>array</code></dt>
<dd><p>Convert array of [lat,lng] to array of {x,y}</p>
</dd>
<dt><a href="#hm_coords2XY">hm:coords2XY(coords)</a> ⇒ <code>array</code></dt>
<dd><p>Convert array of [lat,lng] to array of {x,y}</p>
</dd>
<dt><a href="#hm_coords2bb">hm:coords2bb(coords)</a> ⇒ <code>Object</code></dt>
<dd><p>compute the bounding box of an array of corrds</p>
</dd>
<dt><a href="#hm_coords2bb">hm:coords2bb(coords)</a> ⇒ <code>Object</code></dt>
<dd><p>compute the bounding box of an array of corrds</p>
</dd>
<dt><a href="#hm_coordsPDE2Array">hm:coordsPDE2Array(lats, lng)</a> ⇒ <code>array</code></dt>
<dd><p>Convert coords of format PDE: lat or lng  initial/100000, delta / 100000</p>
</dd>
<dt><a href="#hm_coordsPDE2Array">hm:coordsPDE2Array(lats, lng)</a> ⇒ <code>array</code></dt>
<dd><p>Convert coords of format PDE: lat or lng  initial/100000, delta / 100000</p>
</dd>
<dt><a href="#hm_countTiles">hm:countTiles(bbox, level)</a> ⇒ <code>int</code></dt>
<dd><p>count the number of tiles for a given bounding box and zoom level</p>
</dd>
<dt><a href="#hm_countTiles">hm:countTiles(bbox, level)</a> ⇒ <code>int</code></dt>
<dd><p>count the number of tiles for a given bounding box and zoom level</p>
</dd>
<dt><a href="#hm_detour">hm:detour(start, stop, waypoints)</a> ⇒ <code>Promise</code></dt>
<dd><p>Compute the detour for each waypoint provided, compared to normal route from A to B</p>
</dd>
<dt><a href="#hm_detour">hm:detour(start, stop, waypoints)</a> ⇒ <code>Promise</code></dt>
<dd><p>Compute the detour for each waypoint provided, compared to normal route from A to B</p>
</dd>
<dt><a href="#hm_geocode">hm:geocode(address, opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>geocode an address</p>
</dd>
<dt><a href="#hm_geocode">hm:geocode(address, opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>geocode an address</p>
</dd>
<dt><a href="#hm_geocoderAutocomplete">hm:geocoderAutocomplete(opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>reverse geocode a coordinate. Can centered on a location or within a bounding box</p>
</dd>
<dt><a href="#hm_geocoderAutocomplete">hm:geocoderAutocomplete(opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>reverse geocode a coordinate. Can centered on a location or within a bounding box</p>
</dd>
<dt><a href="#hm_getAvailableMapStyle">hm:getAvailableMapStyle()</a> ⇒ <code>json</code></dt>
<dd><p>list of all available map styles normal.day, night....</p>
</dd>
<dt><a href="#hm_getAvailableMapStyle">hm:getAvailableMapStyle()</a> ⇒ <code>json</code></dt>
<dd><p>list of all available map styles normal.day, night....</p>
</dd>
<dt><a href="#hm_getCenter">hm:getCenter()</a> ⇒ <code>coord</code></dt>
<dd><p>return coordinate of the center of the map</p>
</dd>
<dt><a href="#hm_getCenter">hm:getCenter()</a> ⇒ <code>coord</code></dt>
<dd><p>return coordinate of the center of the map</p>
</dd>
<dt><a href="#hm_getDefaultLayers">hm:getDefaultLayers()</a> ⇒ <code>object</code></dt>
<dd><p>return default layers, created by _platform.createDefaultLayers();</p>
</dd>
<dt><a href="#hm_getDefaultLayers">hm:getDefaultLayers()</a> ⇒ <code>object</code></dt>
<dd><p>return default layers, created by _platform.createDefaultLayers();</p>
</dd>
<dt><a href="#hm_getPlatform">hm:getPlatform()</a> ⇒ <code>object</code></dt>
<dd><p>return platorm;</p>
</dd>
<dt><a href="#hm_getPlatform">hm:getPlatform()</a> ⇒ <code>object</code></dt>
<dd><p>return platorm;</p>
</dd>
<dt><a href="#hm_getThrottleLimits">hm:getThrottleLimits()</a> ⇒ <code>string</code></dt>
<dd><p>get Throttle limts for various modules</p>
</dd>
<dt><a href="#hm_getThrottleLimits">hm:getThrottleLimits()</a> ⇒ <code>string</code></dt>
<dd><p>get Throttle limts for various modules</p>
</dd>
<dt><a href="#hm_getViewBB">hm:getViewBB()</a> ⇒ <code>Object</code></dt>
<dd><p>return bounding box of visible part of map</p>
</dd>
<dt><a href="#hm_getViewBB">hm:getViewBB()</a> ⇒ <code>Object</code></dt>
<dd><p>return bounding box of visible part of map</p>
</dd>
<dt><a href="#hm_getZoom">hm:getZoom()</a> ⇒ <code>number</code></dt>
<dd><p>return zoom value</p>
</dd>
<dt><a href="#hm_getZoom">hm:getZoom()</a> ⇒ <code>number</code></dt>
<dd><p>return zoom value</p>
</dd>
<dt><a href="#hm_htmlBounding">hm:htmlBounding()</a> ⇒ <code>object</code></dt>
<dd><p>provide bounding box of element hosting map, relative to window</p>
</dd>
<dt><a href="#hm_htmlBounding">hm:htmlBounding()</a> ⇒ <code>object</code></dt>
<dd><p>provide bounding box of element hosting map, relative to window</p>
</dd>
<dt><a href="#hm_isoline">hm:isoline(opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>compute an isoline. <a href="http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer&#39;s%20Guide.pdf">See more info on optional parameters</a></p>
</dd>
<dt><a href="#hm_isoline">hm:isoline(opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>compute an isoline. <a href="http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer&#39;s%20Guide.pdf">See more info on optional parameters</a></p>
</dd>
<dt><a href="#hm_layerCreate">hm:layerCreate(name, visible)</a></dt>
<dd><p>create a layer</p>
</dd>
<dt><a href="#hm_layerCreate">hm:layerCreate(name, visible)</a></dt>
<dd><p>create a layer</p>
</dd>
<dt><a href="#hm_layerDelete">hm:layerDelete(name)</a></dt>
<dd><p>delete a layer</p>
</dd>
<dt><a href="#hm_layerDelete">hm:layerDelete(name)</a></dt>
<dd><p>delete a layer</p>
</dd>
<dt><a href="#hm_layerEmpty">hm:layerEmpty(layer)</a></dt>
<dd><p>Empty a layer, or create it if not existing</p>
</dd>
<dt><a href="#hm_layerEmpty">hm:layerEmpty(layer)</a></dt>
<dd><p>Empty a layer, or create it if not existing</p>
</dd>
<dt><a href="#hm_layerFind">hm:layerFind(name)</a></dt>
<dd><p>find layer by its name or return null</p>
</dd>
<dt><a href="#hm_layerFind">hm:layerFind(name)</a></dt>
<dd><p>find layer by its name or return null</p>
</dd>
<dt><a href="#hm_layerSetVisibility">hm:layerSetVisibility(name, visible)</a></dt>
<dd><p>create a layer</p>
</dd>
<dt><a href="#hm_layerSetVisibility">hm:layerSetVisibility(name, visible)</a></dt>
<dd><p>create a layer</p>
</dd>
<dt><a href="#hm_linkid">hm:linkid(linkid)</a> ⇒ <code>Promise</code></dt>
<dd><p>get linkid Information, based on routing</p>
</dd>
<dt><a href="#hm_linkid">hm:linkid(linkid)</a> ⇒ <code>Promise</code></dt>
<dd><p>get linkid Information, based on routing</p>
</dd>
<dt><a href="#hm_locateMe">hm:locateMe(callback, opt)</a></dt>
<dd><p>watch position on HTML5 position. This requires HTTPS. Creates layer &quot;_gps&quot;. To deactivate, call with null callback</p>
</dd>
<dt><a href="#hm_locateMe">hm:locateMe(callback, opt)</a></dt>
<dd><p>watch position on HTML5 position. This requires HTTPS. Creates layer &quot;_gps&quot;. To deactivate, call with null callback</p>
</dd>
<dt><a href="#hm_map">hm:map(htmlItem, opt)</a></dt>
<dd><p>create a map area within the specified item</p>
</dd>
<dt><a href="#hm_map">hm:map(htmlItem, opt)</a></dt>
<dd><p>create a map area within the specified item</p>
</dd>
<dt><a href="#hm_marker">hm:marker(opt)</a> ⇒ <code>H.map.Marker</code></dt>
<dd><p>add a marker in a layer. SVG files can be created with <a href="https://editor.method.ac/">https://editor.method.ac/</a></p>
</dd>
<dt><a href="#hm_marker">hm:marker(opt)</a> ⇒ <code>H.map.Marker</code></dt>
<dd><p>add a marker in a layer. SVG files can be created with <a href="https://editor.method.ac/">https://editor.method.ac/</a></p>
</dd>
<dt><a href="#hm_matrix">hm:matrix(source, dest, opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>compute a matrix. <a href="http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer&#39;s%20Guide.pdf">See more info on optional parameters</a></p>
<p>Matrix size is limited to 1x100, 100x1 or 15xN</p>
</dd>
<dt><a href="#hm_matrix">hm:matrix(source, dest, opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>compute a matrix. <a href="http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer&#39;s%20Guide.pdf">See more info on optional parameters</a></p>
<p>Matrix size is limited to 1x100, 100x1 or 15xN</p>
</dd>
<dt><a href="#hm_placeAutoSuggest">hm:placeAutoSuggest(opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>Autocomplete of Places (POI). Can be centered on a locaiton or within a bounding box</p>
</dd>
<dt><a href="#hm_placeAutoSuggest">hm:placeAutoSuggest(opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>Autocomplete of Places (POI). Can be centered on a locaiton or within a bounding box</p>
</dd>
<dt><a href="#hm_placeExplore">hm:placeExplore(opt, categories)</a> ⇒ <code>array</code></dt>
<dd><p>Discover places (POI) around a coordnate belonging to a list of categories</p>
</dd>
<dt><a href="#hm_placeExplore">hm:placeExplore(opt, categories)</a> ⇒ <code>array</code></dt>
<dd><p>Discover places (POI) around a coordnate belonging to a list of categories</p>
</dd>
<dt><a href="#hm_placeGetCategory">hm:placeGetCategory(center)</a> ⇒ <code>promise</code></dt>
<dd><p>Get Categories of Places (POI)</p>
</dd>
<dt><a href="#hm_placeGetCategory">hm:placeGetCategory(center)</a> ⇒ <code>promise</code></dt>
<dd><p>Get Categories of Places (POI)</p>
</dd>
<dt><a href="#hm_placeSearch">hm:placeSearch(opt, categories)</a> ⇒ <code>promise</code></dt>
<dd><p>Search for a Place (POI) around a coordinate matching a name</p>
</dd>
<dt><a href="#hm_placeSearch">hm:placeSearch(opt, categories)</a> ⇒ <code>promise</code></dt>
<dd><p>Search for a Place (POI) around a coordinate matching a name</p>
</dd>
<dt><a href="#hm_point2Coord">hm:point2Coord({lat,lng})</a> ⇒ <code>array</code></dt>
<dd><p>Convert {lat,lng} to [lat,lng]</p>
</dd>
<dt><a href="#hm_point2Coord">hm:point2Coord({lat,lng})</a> ⇒ <code>array</code></dt>
<dd><p>Convert {lat,lng} to [lat,lng]</p>
</dd>
<dt><a href="#hm_polygon">hm:polygon(opt)</a></dt>
<dd><p>Draw a polygon</p>
</dd>
<dt><a href="#hm_polygon">hm:polygon(opt)</a></dt>
<dd><p>Draw a polygon</p>
</dd>
<dt><a href="#hm_polyline">hm:polyline(opt)</a></dt>
<dd><p>Draw a polyline.</p>
</dd>
<dt><a href="#hm_polyline">hm:polyline(opt)</a></dt>
<dd><p>Draw a polyline.</p>
</dd>
<dt><a href="#hm_reverseGeocode">hm:reverseGeocode(coord)</a> ⇒ <code>Promise</code></dt>
<dd><p>reverse geocode a coordinate</p>
</dd>
<dt><a href="#hm_reverseGeocode">hm:reverseGeocode(coord)</a> ⇒ <code>Promise</code></dt>
<dd><p>reverse geocode a coordinate</p>
</dd>
<dt><a href="#hm_route">hm:route(source, dest, opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>compute a route with optional waypooints. <a href="http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer&#39;s%20Guide.pdf">See more info on optional parameters</a></p>
</dd>
<dt><a href="#hm_route">hm:route(source, dest, opt)</a> ⇒ <code>Promise</code></dt>
<dd><p>compute a route with optional waypooints. <a href="http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer&#39;s%20Guide.pdf">See more info on optional parameters</a></p>
</dd>
<dt><a href="#hm_screenshot">hm:screenshot(opt, opt)</a> ⇒ <code>data</code></dt>
<dd><p>perform a screenshot of the map and returns a promise with the data</p>
</dd>
<dt><a href="#hm_screenshot">hm:screenshot(opt, opt)</a> ⇒ <code>data</code></dt>
<dd><p>perform a screenshot of the map and returns a promise with the data</p>
</dd>
<dt><a href="#hm_setCenter">hm:setCenter(coord)</a></dt>
<dd><p>set center of the map</p>
</dd>
<dt><a href="#hm_setCenter">hm:setCenter(coord)</a></dt>
<dd><p>set center of the map</p>
</dd>
<dt><a href="#hm_setScheme">hm:setScheme(scheme)</a></dt>
<dd><p>define the scheme. List of scheme can be obtained from hm.getAvailableMapStyle()</p>
</dd>
<dt><a href="#hm_setScheme">hm:setScheme(scheme)</a></dt>
<dd><p>define the scheme. List of scheme can be obtained from hm.getAvailableMapStyle()</p>
</dd>
<dt><a href="#hm_setViewBB">hm:setViewBB(opt)</a></dt>
<dd><p>sets bouding box to be displayed</p>
</dd>
<dt><a href="#hm_setViewBB">hm:setViewBB(opt)</a></dt>
<dd><p>sets bouding box to be displayed</p>
</dd>
<dt><a href="#hm_setZoom">hm:setZoom(zoom)</a></dt>
<dd><p>set zoom level</p>
</dd>
<dt><a href="#hm_setZoom">hm:setZoom(zoom)</a></dt>
<dd><p>set zoom level</p>
</dd>
<dt><a href="#hm_simplify">hm:simplify(coords, tolerance)</a> ⇒ <code>array</code></dt>
<dd><p>Simplify a polyline by using the Ramer-Douglas-Peucker algorithm</p>
</dd>
<dt><a href="#hm_simplify">hm:simplify(coords, tolerance)</a> ⇒ <code>array</code></dt>
<dd><p>Simplify a polyline by using the Ramer-Douglas-Peucker algorithm</p>
</dd>
<dt><a href="#hm_tile2BB">hm:tile2BB(tileX, tileY, level)</a> ⇒ <code>Object</code></dt>
<dd><p>compute the bounding box of a Tile</p>
</dd>
<dt><a href="#hm_tile2BB">hm:tile2BB(tileX, tileY, level)</a> ⇒ <code>Object</code></dt>
<dd><p>compute the bounding box of a Tile</p>
</dd>
<dt><a href="#hm_touch">hm:touch(onoff, options)</a></dt>
<dd><p>activate touch, allowing hand drawing, with embedded simplification of the line</p>
</dd>
<dt><a href="#hm_touch">hm:touch(onoff, options)</a></dt>
<dd><p>activate touch, allowing hand drawing, with embedded simplification of the line</p>
</dd>
<dt><a href="#hm_xy2Coords">hm:xy2Coords(coords)</a> ⇒ <code>array</code></dt>
<dd><p>Convert array of {x,y} to array of [lat,lng]</p>
</dd>
<dt><a href="#hm_xy2Coords">hm:xy2Coords(coords)</a> ⇒ <code>array</code></dt>
<dd><p>Convert array of {x,y} to array of [lat,lng]</p>
</dd>
<dt><a href="#lineIntersects">lineIntersects(A, B, C, D)</a></dt>
<dd></dd>
<dt><a href="#marker_getCoord">marker:getCoord()</a> ⇒ <code>coord</code></dt>
<dd><p>get coordinates of a marker</p>
</dd>
<dt><a href="#marker_getCoord">marker:getCoord()</a> ⇒ <code>coord</code></dt>
<dd><p>get coordinates of a marker</p>
</dd>
<dt><a href="#stringify">stringify()</a></dt>
<dd><p>Stringifies a GeoJSON object into WKT</p>
</dd>
</dl>

<a name="hm_PDEManager"></a>

## hm:PDEManager(opt)
Manage PDE requests

**Kind**: global function  
**Params**

- opt <code>Object</code> - optional object {rps,concurrent}
    - [.rps] <code>int</code> - requests per second. Default = 10
    - [.concurrent] <code>int</code> - max concurrent requests. Default = 5

**Example**  
```js
const hm = window.heremap;
const pde = new hm.PDEManager({rps:10});

const layers = {
    ROAD_GEOM_FC: {
       callback: pdeGotRoadGeomFC,
       fcLayers: [1,2]
    }, 
    POI_BIGGER: {
      callback: pdeGotPOI,
      level: 6
  };

 let bb = hm.getViewBB();
 pde.setBoundingBox(bb);
 pde.setLayers(layers);
 pde.run().then(nbtile=> {console.log(nbtiles)});
 ```

* [hm:PDEManager(opt)](#hm_PDEManager)
    * [.getQueue()](#hm_PDEManager.getQueue) ⇒ <code>object</code>
    * [.getQueue()](#hm_PDEManager.getQueue) ⇒ <code>object</code>
    * [.getTilesInfo()](#hm_PDEManager.getTilesInfo) ⇒ <code>array</code>
    * [.getTilesInfo()](#hm_PDEManager.getTilesInfo) ⇒ <code>array</code>
    * [.run()](#hm_PDEManager.run) ⇒ <code>Promise</code>
    * [.run()](#hm_PDEManager.run) ⇒ <code>Promise</code>
    * [.setBoundingBox(bb)](#hm_PDEManager.setBoundingBox)
    * [.setBoundingBox(bb)](#hm_PDEManager.setBoundingBox)
    * [.setBoundingCoords(coords, add)](#hm_PDEManager.setBoundingCoords)
    * [.setBoundingCoords(coords, add)](#hm_PDEManager.setBoundingCoords)
    * [.setBoundingPolys(polygons, add)](#hm_PDEManager.setBoundingPolys)
    * [.setBoundingPolys(polygons, add)](#hm_PDEManager.setBoundingPolys)
    * [.setLayers(layers)](#hm_PDEManager.setLayers)
    * [.setLayers(layers)](#hm_PDEManager.setLayers)
    * [.setQueue(queue)](#hm_PDEManager.setQueue)
    * [.setQueue(queue)](#hm_PDEManager.setQueue)

<a name="hm_PDEManager.getQueue"></a>

### hm:PDEManager.getQueue() ⇒ <code>object</code>
returns the current queue to be processed

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>object</code> - - {key:callback,key:callback,....} where key = "x/y/z/layername"  
<a name="hm_PDEManager.getQueue"></a>

### hm:PDEManager.getQueue() ⇒ <code>object</code>
returns the current queue to be processed

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>object</code> - - {key:callback,key:callback,....} where key = "x/y/z/layername"  
<a name="hm_PDEManager.getTilesInfo"></a>

### hm:PDEManager.getTilesInfo() ⇒ <code>array</code>
provides array of rectangle showing various info for each tile downloaded

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>array</code> - of {bb,tileX,tileY,level} for each tiles downloaded  
<a name="hm_PDEManager.getTilesInfo"></a>

### hm:PDEManager.getTilesInfo() ⇒ <code>array</code>
provides array of rectangle showing various info for each tile downloaded

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>array</code> - of {bb,tileX,tileY,level} for each tiles downloaded  
<a name="hm_PDEManager.run"></a>

### hm:PDEManager.run() ⇒ <code>Promise</code>
run the queries in the queue, with throttle in place

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>Promise</code> - - returns promise with count of tiles as parameter  
<a name="hm_PDEManager.run"></a>

### hm:PDEManager.run() ⇒ <code>Promise</code>
run the queries in the queue, with throttle in place

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>Promise</code> - - returns promise with count of tiles as parameter  
<a name="hm_PDEManager.setBoundingBox"></a>

### hm:PDEManager.setBoundingBox(bb)
sets a bounding box to retrieve all the tiles in it

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- bb <code>Object</code> - bounding box {latm,latM,lngm,lngM}
```js
const bb={
   latm: 43.3494,
   latM: 43.8325,
   lngm: 2.2221
   lngM: 2.5685
};
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingBox"></a>

### hm:PDEManager.setBoundingBox(bb)
sets a bounding box to retrieve all the tiles in it

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- bb <code>Object</code> - bounding box {latm,latM,lngm,lngM}
```js
const bb={
   latm: 43.3494,
   latM: 43.8325,
   lngm: 2.2221
   lngM: 2.5685
};
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingCoords"></a>

### hm:PDEManager.setBoundingCoords(coords, add)
retrieve all tiles needed for a list of coords

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- coords <code>array</code> - array of [lat,lng]
- add <code>boolean</code> - false by default. set to true to add to existing queue
```js
const bb={
   latm: 43.3494,
   latM: 43.8325,
   lngm: 2.2221
   lngM: 2.5685
};
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingCoords"></a>

### hm:PDEManager.setBoundingCoords(coords, add)
retrieve all tiles needed for a list of coords

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- coords <code>array</code> - array of [lat,lng]
- add <code>boolean</code> - false by default. set to true to add to existing queue
```js
const bb={
   latm: 43.3494,
   latM: 43.8325,
   lngm: 2.2221
   lngM: 2.5685
};
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingPolys"></a>

### hm:PDEManager.setBoundingPolys(polygons, add)
sets a list of polygons to contain the tiles.
A Til is IN if one of the corner is in one of the polygons

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- polygons <code>array</code> - array of [[lat,lng],[lat,lng]..]
- add <code>boolean</code> - false by default. set to true to add to existing queue
```js
const poly=[
     [[43.3,2.8],[43.35,2.34],[43.37,2.38]],
     [[48.8,0.4],[48.81,0.456],48.82,0.433],[48.83,0.45]
];
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingPolys"></a>

### hm:PDEManager.setBoundingPolys(polygons, add)
sets a list of polygons to contain the tiles.
A Til is IN if one of the corner is in one of the polygons

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- polygons <code>array</code> - array of [[lat,lng],[lat,lng]..]
- add <code>boolean</code> - false by default. set to true to add to existing queue
```js
const poly=[
     [[43.3,2.8],[43.35,2.34],[43.37,2.38]],
     [[48.8,0.4],[48.81,0.456],48.82,0.433],[48.83,0.45]
];
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setLayers"></a>

### hm:PDEManager.setLayers(layers)
define the layers to be fetched

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- layers <code>object</code> - {layerName:{level,callback,fcLayers},.....}
    - [.layerName] <code>string</code> - name of layer
    - [.callback] <code>function</code> - function to be called for each PDE request. parameters for call: (content,x,y,z,layerName)
    - [.level] <code>integer</code> - level for tile associated to specific layer. if not specified, layer.fcLayers is used
    - [.fcLayers] <code>array</code> - array of FC level, from 1 to 5
```js
const layers = {
    ROAD_GEOM_FC: {
       callback: pdeGotRoadGeomFC,
       fcLayers: [1,2]
    }, 
    POI_BIGGER: {
      callback: pdeGotPOI,
      level: 6
  };

 pde.setLayers(layers);
 ```

<a name="hm_PDEManager.setLayers"></a>

### hm:PDEManager.setLayers(layers)
define the layers to be fetched

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- layers <code>object</code> - {layerName:{level,callback,fcLayers},.....}
    - [.layerName] <code>string</code> - name of layer
    - [.callback] <code>function</code> - function to be called for each PDE request. parameters for call: (content,x,y,z,layerName)
    - [.level] <code>integer</code> - level for tile associated to specific layer. if not specified, layer.fcLayers is used
    - [.fcLayers] <code>array</code> - array of FC level, from 1 to 5
```js
const layers = {
    ROAD_GEOM_FC: {
       callback: pdeGotRoadGeomFC,
       fcLayers: [1,2]
    }, 
    POI_BIGGER: {
      callback: pdeGotPOI,
      level: 6
  };

 pde.setLayers(layers);
 ```

<a name="hm_PDEManager.setQueue"></a>

### hm:PDEManager.setQueue(queue)
set the queue to run, form a list of tiles

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- queue <code>object</code> - {key:callback,key:callback,....} where key = "x/y/z/layername"

<a name="hm_PDEManager.setQueue"></a>

### hm:PDEManager.setQueue(queue)
set the queue to run, form a list of tiles

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- queue <code>object</code> - {key:callback,key:callback,....} where key = "x/y/z/layername"

<a name="hm_PDEManager"></a>

## hm:PDEManager(opt)
Manage PDE requests

**Kind**: global function  
**Params**

- opt <code>Object</code> - optional object {rps,concurrent}
    - [.rps] <code>int</code> - requests per second. Default = 10
    - [.concurrent] <code>int</code> - max concurrent requests. Default = 5

**Example**  
```js
const hm = window.heremap;
const pde = new hm.PDEManager({rps:10});

const layers = {
    ROAD_GEOM_FC: {
       callback: pdeGotRoadGeomFC,
       fcLayers: [1,2]
    }, 
    POI_BIGGER: {
      callback: pdeGotPOI,
      level: 6
  };

 let bb = hm.getViewBB();
 pde.setBoundingBox(bb);
 pde.setLayers(layers);
 pde.run().then(nbtile=> {console.log(nbtiles)});
 ```

* [hm:PDEManager(opt)](#hm_PDEManager)
    * [.getQueue()](#hm_PDEManager.getQueue) ⇒ <code>object</code>
    * [.getQueue()](#hm_PDEManager.getQueue) ⇒ <code>object</code>
    * [.getTilesInfo()](#hm_PDEManager.getTilesInfo) ⇒ <code>array</code>
    * [.getTilesInfo()](#hm_PDEManager.getTilesInfo) ⇒ <code>array</code>
    * [.run()](#hm_PDEManager.run) ⇒ <code>Promise</code>
    * [.run()](#hm_PDEManager.run) ⇒ <code>Promise</code>
    * [.setBoundingBox(bb)](#hm_PDEManager.setBoundingBox)
    * [.setBoundingBox(bb)](#hm_PDEManager.setBoundingBox)
    * [.setBoundingCoords(coords, add)](#hm_PDEManager.setBoundingCoords)
    * [.setBoundingCoords(coords, add)](#hm_PDEManager.setBoundingCoords)
    * [.setBoundingPolys(polygons, add)](#hm_PDEManager.setBoundingPolys)
    * [.setBoundingPolys(polygons, add)](#hm_PDEManager.setBoundingPolys)
    * [.setLayers(layers)](#hm_PDEManager.setLayers)
    * [.setLayers(layers)](#hm_PDEManager.setLayers)
    * [.setQueue(queue)](#hm_PDEManager.setQueue)
    * [.setQueue(queue)](#hm_PDEManager.setQueue)

<a name="hm_PDEManager.getQueue"></a>

### hm:PDEManager.getQueue() ⇒ <code>object</code>
returns the current queue to be processed

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>object</code> - - {key:callback,key:callback,....} where key = "x/y/z/layername"  
<a name="hm_PDEManager.getQueue"></a>

### hm:PDEManager.getQueue() ⇒ <code>object</code>
returns the current queue to be processed

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>object</code> - - {key:callback,key:callback,....} where key = "x/y/z/layername"  
<a name="hm_PDEManager.getTilesInfo"></a>

### hm:PDEManager.getTilesInfo() ⇒ <code>array</code>
provides array of rectangle showing various info for each tile downloaded

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>array</code> - of {bb,tileX,tileY,level} for each tiles downloaded  
<a name="hm_PDEManager.getTilesInfo"></a>

### hm:PDEManager.getTilesInfo() ⇒ <code>array</code>
provides array of rectangle showing various info for each tile downloaded

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>array</code> - of {bb,tileX,tileY,level} for each tiles downloaded  
<a name="hm_PDEManager.run"></a>

### hm:PDEManager.run() ⇒ <code>Promise</code>
run the queries in the queue, with throttle in place

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>Promise</code> - - returns promise with count of tiles as parameter  
<a name="hm_PDEManager.run"></a>

### hm:PDEManager.run() ⇒ <code>Promise</code>
run the queries in the queue, with throttle in place

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Returns**: <code>Promise</code> - - returns promise with count of tiles as parameter  
<a name="hm_PDEManager.setBoundingBox"></a>

### hm:PDEManager.setBoundingBox(bb)
sets a bounding box to retrieve all the tiles in it

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- bb <code>Object</code> - bounding box {latm,latM,lngm,lngM}
```js
const bb={
   latm: 43.3494,
   latM: 43.8325,
   lngm: 2.2221
   lngM: 2.5685
};
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingBox"></a>

### hm:PDEManager.setBoundingBox(bb)
sets a bounding box to retrieve all the tiles in it

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- bb <code>Object</code> - bounding box {latm,latM,lngm,lngM}
```js
const bb={
   latm: 43.3494,
   latM: 43.8325,
   lngm: 2.2221
   lngM: 2.5685
};
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingCoords"></a>

### hm:PDEManager.setBoundingCoords(coords, add)
retrieve all tiles needed for a list of coords

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- coords <code>array</code> - array of [lat,lng]
- add <code>boolean</code> - false by default. set to true to add to existing queue
```js
const bb={
   latm: 43.3494,
   latM: 43.8325,
   lngm: 2.2221
   lngM: 2.5685
};
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingCoords"></a>

### hm:PDEManager.setBoundingCoords(coords, add)
retrieve all tiles needed for a list of coords

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- coords <code>array</code> - array of [lat,lng]
- add <code>boolean</code> - false by default. set to true to add to existing queue
```js
const bb={
   latm: 43.3494,
   latM: 43.8325,
   lngm: 2.2221
   lngM: 2.5685
};
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingPolys"></a>

### hm:PDEManager.setBoundingPolys(polygons, add)
sets a list of polygons to contain the tiles.
A Til is IN if one of the corner is in one of the polygons

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- polygons <code>array</code> - array of [[lat,lng],[lat,lng]..]
- add <code>boolean</code> - false by default. set to true to add to existing queue
```js
const poly=[
     [[43.3,2.8],[43.35,2.34],[43.37,2.38]],
     [[48.8,0.4],[48.81,0.456],48.82,0.433],[48.83,0.45]
];
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setBoundingPolys"></a>

### hm:PDEManager.setBoundingPolys(polygons, add)
sets a list of polygons to contain the tiles.
A Til is IN if one of the corner is in one of the polygons

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- polygons <code>array</code> - array of [[lat,lng],[lat,lng]..]
- add <code>boolean</code> - false by default. set to true to add to existing queue
```js
const poly=[
     [[43.3,2.8],[43.35,2.34],[43.37,2.38]],
     [[48.8,0.4],[48.81,0.456],48.82,0.433],[48.83,0.45]
];
pde.setBoundingBox(bb);
 ```

<a name="hm_PDEManager.setLayers"></a>

### hm:PDEManager.setLayers(layers)
define the layers to be fetched

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- layers <code>object</code> - {layerName:{level,callback,fcLayers},.....}
    - [.layerName] <code>string</code> - name of layer
    - [.callback] <code>function</code> - function to be called for each PDE request. parameters for call: (content,x,y,z,layerName)
    - [.level] <code>integer</code> - level for tile associated to specific layer. if not specified, layer.fcLayers is used
    - [.fcLayers] <code>array</code> - array of FC level, from 1 to 5
```js
const layers = {
    ROAD_GEOM_FC: {
       callback: pdeGotRoadGeomFC,
       fcLayers: [1,2]
    }, 
    POI_BIGGER: {
      callback: pdeGotPOI,
      level: 6
  };

 pde.setLayers(layers);
 ```

<a name="hm_PDEManager.setLayers"></a>

### hm:PDEManager.setLayers(layers)
define the layers to be fetched

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- layers <code>object</code> - {layerName:{level,callback,fcLayers},.....}
    - [.layerName] <code>string</code> - name of layer
    - [.callback] <code>function</code> - function to be called for each PDE request. parameters for call: (content,x,y,z,layerName)
    - [.level] <code>integer</code> - level for tile associated to specific layer. if not specified, layer.fcLayers is used
    - [.fcLayers] <code>array</code> - array of FC level, from 1 to 5
```js
const layers = {
    ROAD_GEOM_FC: {
       callback: pdeGotRoadGeomFC,
       fcLayers: [1,2]
    }, 
    POI_BIGGER: {
      callback: pdeGotPOI,
      level: 6
  };

 pde.setLayers(layers);
 ```

<a name="hm_PDEManager.setQueue"></a>

### hm:PDEManager.setQueue(queue)
set the queue to run, form a list of tiles

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- queue <code>object</code> - {key:callback,key:callback,....} where key = "x/y/z/layername"

<a name="hm_PDEManager.setQueue"></a>

### hm:PDEManager.setQueue(queue)
set the queue to run, form a list of tiles

**Kind**: static method of [<code>hm:PDEManager</code>](#hm_PDEManager)  
**Params**

- queue <code>object</code> - {key:callback,key:callback,....} where key = "x/y/z/layername"

<a name="hm_bb2Poly"></a>

## hm:bb2Poly(bb) ⇒ <code>array</code>
convert a bounding box into a list of five [lat,lng], last is same as first

**Kind**: global function  
**Returns**: <code>array</code> - - [[latm,lngm],[latM,lngm],[latM,lngM],[latm,lngM],[latm,lngm]]  
**Params**

- bb <code>Object</code> - {latm,latM,lngm,lngM}

<a name="hm_bb2Poly"></a>

## hm:bb2Poly(bb) ⇒ <code>array</code>
convert a bounding box into a list of five [lat,lng], last is same as first

**Kind**: global function  
**Returns**: <code>array</code> - - [[latm,lngm],[latM,lngm],[latM,lngM],[latm,lngM],[latm,lngm]]  
**Params**

- bb <code>Object</code> - {latm,latM,lngm,lngM}

<a name="hm_bubbleUnique"></a>

## hm:bubbleUnique(coord, txt)
Display a unique bubble. Associated CSS style is .H_ib_body

**Kind**: global function  
**Params**

- coord <code>Array</code> - of the bubble
- txt <code>String</code> - html text to display

<a name="hm_bubbleUnique"></a>

## hm:bubbleUnique(coord, txt)
Display a unique bubble. Associated CSS style is .H_ib_body

**Kind**: global function  
**Params**

- coord <code>Array</code> - of the bubble
- txt <code>String</code> - html text to display

<a name="hm_bubbleUniqueHide"></a>

## hm:bubbleUniqueHide()
hide a unique bubble

**Kind**: global function  
<a name="hm_bubbleUniqueHide"></a>

## hm:bubbleUniqueHide()
hide a unique bubble

**Kind**: global function  
<a name="hm_buildIcon"></a>

## hm:buildIcon(opt) ⇒ <code>promise</code>
create an icon, to be used for a marker

**Kind**: global function  
**Returns**: <code>promise</code> - the promise of created icon of type H.map.Icon  
**Params**

- opt <code>object</code> - options to specify the icon
    - [.img] <code>string</code> - use a png/jpg image. Specify the url
    - [.svg] <code>string</code> - url a svg. This can be an inline svg, a url, or a svg from heremap
    - [.opt] <code>object</code> - style object
        - [.size] <code>number</code> | <code>string</code> - size of icon, as 24 or 24x32
        - [.ratio] <code>number</code> - for svg files, ratio of size. 0.5 = half
        - [.anchor] <code>number</code> | <code>string</code> - anchor of icon, as 24 or "24x32" or "center". By default, bottom-center
        - [.tag] <code>string</code> - for svg, any tag like {tag} within the svg file will be replaced by its associated value

**Example**  
```js
hm.buildIcon({
   img: "http://whatever.com/image.png",
   opt: {size:24}
});

hm.buildIcon({
   svg: "http://whatever.com/image.svg",
   opt: {
      ratio:0.5,
      anchor:24x32
   }
});
 
hm.buildIcon({
   svg: "@svg/cluster.svg",
   opt: {
      size:24,
      color:"red"
   }
});

const svg = `<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"> <ellipse stroke="null" ry="8" rx="7.618896" id="svg_1" cy="8" cx="7.837427" fill="{color}" fill-opacity="0.9"/></svg>`;
hm.buildIcon({
   svg: svg,
   opt: {
      size:24,
      color:"red"
   } 
});
 ```
<a name="hm_buildIcon"></a>

## hm:buildIcon(opt) ⇒ <code>promise</code>
create an icon, to be used for a marker

**Kind**: global function  
**Returns**: <code>promise</code> - the promise of created icon of type H.map.Icon  
**Params**

- opt <code>object</code> - options to specify the icon
    - [.img] <code>string</code> - use a png/jpg image. Specify the url
    - [.svg] <code>string</code> - url a svg. This can be an inline svg, a url, or a svg from heremap
    - [.opt] <code>object</code> - style object
        - [.size] <code>number</code> | <code>string</code> - size of icon, as 24 or 24x32
        - [.ratio] <code>number</code> - for svg files, ratio of size. 0.5 = half
        - [.anchor] <code>number</code> | <code>string</code> - anchor of icon, as 24 or "24x32" or "center". By default, bottom-center
        - [.tag] <code>string</code> - for svg, any tag like {tag} within the svg file will be replaced by its associated value

**Example**  
```js
hm.buildIcon({
   img: "http://whatever.com/image.png",
   opt: {size:24}
});

hm.buildIcon({
   svg: "http://whatever.com/image.svg",
   opt: {
      ratio:0.5,
      anchor:24x32
   }
});
 
hm.buildIcon({
   svg: "@svg/cluster.svg",
   opt: {
      size:24,
      color:"red"
   }
});

const svg = `<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"> <ellipse stroke="null" ry="8" rx="7.618896" id="svg_1" cy="8" cx="7.837427" fill="{color}" fill-opacity="0.9"/></svg>`;
hm.buildIcon({
   svg: svg,
   opt: {
      size:24,
      color:"red"
   } 
});
 ```
<a name="hm_circle"></a>

## hm:circle(opt)
draw a circle

**Kind**: global function  
**Params**

- opt <code>\*</code> - option for circle
    - [.layer] <code>String</code> - optional layer to use
    - [.coord] <code>array</code> - center of the circle, as \[48.8,2.3\]
    - [.radius] <code>number</code> - radius in meter
    - [.style] <code>object</code> - optional graphic style
        - [.strokeColor] <code>string</code> - color of perimeter
        - [.lineWidth] <code>number</code> - line width
        - [.fillColor] <code>string</code> - fill color

<a name="hm_circle"></a>

## hm:circle(opt)
draw a circle

**Kind**: global function  
**Params**

- opt <code>\*</code> - option for circle
    - [.layer] <code>String</code> - optional layer to use
    - [.coord] <code>array</code> - center of the circle, as \[48.8,2.3\]
    - [.radius] <code>number</code> - radius in meter
    - [.style] <code>object</code> - optional graphic style
        - [.strokeColor] <code>string</code> - color of perimeter
        - [.lineWidth] <code>number</code> - line width
        - [.fillColor] <code>string</code> - fill color

<a name="hm_cluster"></a>

## hm:cluster(coords, opt, cb) ⇒ <code>H.map.layer.ObjectLayer</code>
Creates a cluster of points

**Kind**: global function  
**Returns**: <code>H.map.layer.ObjectLayer</code> - layer created  
**Params**

- coords <code>Array</code> - array of \[lat,lng,payload\]
- opt <code>object</code> - options for cluster
    - [.minZoom] <code>number</code> - min zoom for cluster to be visible
    - [.maxZoom] <code>number</code> - max zoom for cluster to be visible
    - [.noise] <code>object</code> - graphic to represent stand-alone point. {icon,size}
        - [.icon] <code>string</code> - png/jpg/svg file. @ as first character indicates a file from this package. Anchor will be bottom-center
        - [.size] <code>number</code> - optional size of icon
    - [.cluster] <code>object</code> - { weight:{icon,size}, weight:{icon,size},... }
        - [.icon] <code>string</code> - png/jpg/svg file to represent group of pois. @ as first character indicates a file from this package. Anchor will be middle of icon
        - [.size] <code>number</code> - size of icon
- cb <code>function</code> - callback to be called if click on item. Format cb(event, coord, payload, weigth). 
`coord` is coord of icon
`payload` is payload associated to point. 
`weight` is number of points aggregated, when clicking on a cluster icon, 1 if single point

**Example**  
```js
let pois = [[48.8,2.3,"Hello world"],[48.5,2.4,"How are you"],[45.2,2.93,"Very well"]];

hm.cluster(pois);

// with more graphic options and callback defined
  let opt = {
   noise: {
         icon: "mcdo.png",
         size: 12
     },
   cluster: {
      200: {
          icon: "@svg/cluster_red.svg",
          size: 64
      },
      75: {
          icon: "@svg/cluster_orange.svg",
          size: 52
      },
      2: {
          icon: "@svg/cluster_green.svg",
          size: 40
       }
   }
  };
 hm.cluster(pois, opt,
          (event, coordinate, data, weight) => {
              if (data)
                  console.log("click on point ", data);
              else
                  console.log("click on cluster with weight", weight);
          });
```
<a name="hm_clusterHide"></a>

## hm:clusterHide()
Hide cluster layer

**Kind**: global function  
<a name="hm_clusterShow"></a>

## hm:clusterShow()
Show cluster layer

**Kind**: global function  
<a name="hm_config"></a>

## hm:config(opt)
To configure app_id, app_code and optionally use CIT and http

**Kind**: global function  
**Params**

- opt <code>Object</code> - `opt` with parameters.
    - [.app_id] <code>string</code> - the app_id from developer.here.com (REST)
    - [.app_code] <code>string</code> - the app_code from developer.here.com (REST)
    - [.api_key] <code>string</code> - the api_key from developer.here.com (JS)
    - [.useCIT] <code>boolean</code> <code> = false</code> - true to use CIT environment.
    - [.useHTTP] <code>string</code> <code> = false</code> - true to use HTTP.
    - [.useHTTPS] <code>string</code> <code> = true</code> - true to use HTTPS.
    - [.rps] <code>object</code> - set rps limit {routing:1,gc:2,rgc:10,pde:10}

**Example**  
```js
 hm.config({
     app_id: "YOUR APP_ID",
     app_code: "YOUR APP_CODE",
     api_key: "YOUR API_KEY",
  });
 ```
<a name="hm_config"></a>

## hm:config(opt)
To configure app_id, app_code and optionally use CIT and http

**Kind**: global function  
**Params**

- opt <code>Object</code> - `opt` with parameters.
    - [.app_id] <code>string</code> - the app_id from developer.here.com (REST)
    - [.app_code] <code>string</code> - the app_code from developer.here.com (REST)
    - [.api_key] <code>string</code> - the api_key from developer.here.com (JS)
    - [.useCIT] <code>boolean</code> <code> = false</code> - true to use CIT environment.
    - [.useHTTP] <code>string</code> <code> = false</code> - true to use HTTP.
    - [.useHTTPS] <code>string</code> <code> = true</code> - true to use HTTPS.
    - [.rps] <code>object</code> - set rps limit {routing:1,gc:2,rgc:10,pde:10}

**Example**  
```js
 hm.config({
     app_id: "YOUR APP_ID",
     app_code: "YOUR APP_CODE",
     api_key: "YOUR API_KEY",
  });
 ```
<a name="hm_coord2Point"></a>

## hm:coord2Point(coord) ⇒ <code>object</code>
Convert [lat,lng] to {lat,lng}

**Kind**: global function  
**Returns**: <code>object</code> - - {lat,lng}  
**Params**

- coord <code>array</code> - [lat,lng]

<a name="hm_coord2Point"></a>

## hm:coord2Point(coord) ⇒ <code>object</code>
Convert [lat,lng] to {lat,lng}

**Kind**: global function  
**Returns**: <code>object</code> - - {lat,lng}  
**Params**

- coord <code>array</code> - [lat,lng]

<a name="hm_coordA2O"></a>

## hm:coordA2O(arr) ⇒ <code>array</code>
Convert an array [lat,lng] to {lat,lng}

**Kind**: global function  
**Returns**: <code>array</code> - {lat,lng}  
**Params**

- arr <code>object</code> - [lat,lng]

<a name="hm_coordA2O"></a>

## hm:coordA2O(arr) ⇒ <code>array</code>
Convert an array [lat,lng] to {lat,lng}

**Kind**: global function  
**Returns**: <code>array</code> - {lat,lng}  
**Params**

- arr <code>object</code> - [lat,lng]

<a name="hm_coordO2A"></a>

## hm:coordO2A(obj) ⇒ <code>array</code>
Convert an object {lat,lng} to [lat,lng]

**Kind**: global function  
**Returns**: <code>array</code> - [lat,lng]  
**Params**

- obj <code>object</code> - {lat,lng}

<a name="hm_coordO2A"></a>

## hm:coordO2A(obj) ⇒ <code>array</code>
Convert an object {lat,lng} to [lat,lng]

**Kind**: global function  
**Returns**: <code>array</code> - [lat,lng]  
**Params**

- obj <code>object</code> - {lat,lng}

<a name="hm_coords2XY"></a>

## hm:coords2XY(coords) ⇒ <code>array</code>
Convert array of [lat,lng] to array of {x,y}

**Kind**: global function  
**Returns**: <code>array</code> - array of {x,y}  
**Params**

- coords <code>array</code> - array of [lat,lng]

<a name="hm_coords2XY"></a>

## hm:coords2XY(coords) ⇒ <code>array</code>
Convert array of [lat,lng] to array of {x,y}

**Kind**: global function  
**Returns**: <code>array</code> - array of {x,y}  
**Params**

- coords <code>array</code> - array of [lat,lng]

<a name="hm_coords2bb"></a>

## hm:coords2bb(coords) ⇒ <code>Object</code>
compute the bounding box of an array of corrds

**Kind**: global function  
**Returns**: <code>Object</code> - - {latm,latM,lngm,lngM}  
**Params**

- coords <code>array</code> - [[lat,lng],[lat,lng]]

<a name="hm_coords2bb"></a>

## hm:coords2bb(coords) ⇒ <code>Object</code>
compute the bounding box of an array of corrds

**Kind**: global function  
**Returns**: <code>Object</code> - - {latm,latM,lngm,lngM}  
**Params**

- coords <code>array</code> - [[lat,lng],[lat,lng]]

<a name="hm_coordsPDE2Array"></a>

## hm:coordsPDE2Array(lats, lng) ⇒ <code>array</code>
Convert coords of format PDE: lat or lng  initial/100000, delta / 100000

**Kind**: global function  
**Returns**: <code>array</code> - [lat,lng]  
**Params**

- lats <code>array</code>
- lng <code>array</code>

<a name="hm_coordsPDE2Array"></a>

## hm:coordsPDE2Array(lats, lng) ⇒ <code>array</code>
Convert coords of format PDE: lat or lng  initial/100000, delta / 100000

**Kind**: global function  
**Returns**: <code>array</code> - [lat,lng]  
**Params**

- lats <code>array</code>
- lng <code>array</code>

<a name="hm_countTiles"></a>

## hm:countTiles(bbox, level) ⇒ <code>int</code>
count the number of tiles for a given bounding box and zoom level

**Kind**: global function  
**Returns**: <code>int</code> - count of tiles  
**Params**

- bbox <code>array</code> - bounding box, as {latm,latM,lngm,lngM};
- level <code>int</code> - zoom level

<a name="hm_countTiles"></a>

## hm:countTiles(bbox, level) ⇒ <code>int</code>
count the number of tiles for a given bounding box and zoom level

**Kind**: global function  
**Returns**: <code>int</code> - count of tiles  
**Params**

- bbox <code>array</code> - bounding box, as {latm,latM,lngm,lngM};
- level <code>int</code> - zoom level

<a name="hm_detour"></a>

## hm:detour(start, stop, waypoints) ⇒ <code>Promise</code>
Compute the detour for each waypoint provided, compared to normal route from A to B

**Kind**: global function  
**Returns**: <code>Promise</code> - returns {reference: {start, stop, distance, distance2, time, time2} ,waypoints:[ {coord, distA, timeA, distB, timeB}]}  
**Params**

- start <code>coord</code> - starting point for route
- stop <code>coord</code> - destination point of route
- waypoints <code>array</code> - list of watypoints to test

<a name="hm_detour"></a>

## hm:detour(start, stop, waypoints) ⇒ <code>Promise</code>
Compute the detour for each waypoint provided, compared to normal route from A to B

**Kind**: global function  
**Returns**: <code>Promise</code> - returns {reference: {start, stop, distance, distance2, time, time2} ,waypoints:[ {coord, distA, timeA, distB, timeB}]}  
**Params**

- start <code>coord</code> - starting point for route
- stop <code>coord</code> - destination point of route
- waypoints <code>array</code> - list of watypoints to test

<a name="hm_geocode"></a>

## hm:geocode(address, opt) ⇒ <code>Promise</code>
geocode an address

**Kind**: global function  
**Returns**: <code>Promise</code> - {coord,body}. coord is geocode as \[lat,lng\]. body is full json answer  
**Params**

- address <code>string</code> - address as string
- opt <code>object</code> - optional additional parameter, for instance {additionaldata:"IncludeShapeLevel,city"}

**Example**  
```js
const res = await hm.geocode("avenue des chaps elysees, paris");
console.log (res.coord);
```
<a name="hm_geocode"></a>

## hm:geocode(address, opt) ⇒ <code>Promise</code>
geocode an address

**Kind**: global function  
**Returns**: <code>Promise</code> - {coord,body}. coord is geocode as \[lat,lng\]. body is full json answer  
**Params**

- address <code>string</code> - address as string
- opt <code>object</code> - optional additional parameter, for instance {additionaldata:"IncludeShapeLevel,city"}

**Example**  
```js
const res = await hm.geocode("avenue des chaps elysees, paris");
console.log (res.coord);
```
<a name="hm_geocoderAutocomplete"></a>

## hm:geocoderAutocomplete(opt) ⇒ <code>Promise</code>
reverse geocode a coordinate. Can centered on a location or within a bounding box

**Kind**: global function  
**Returns**: <code>Promise</code> - returns [{},{}]  
**Params**

- opt <code>Object</code> - {query, bb or center}
    - .search <code>String</code> - text to search
    - .center <code>array</code> - [lat,lng]
    - .bb <code>object</code> - {latm,latM,lngm,lngM}

<a name="hm_geocoderAutocomplete"></a>

## hm:geocoderAutocomplete(opt) ⇒ <code>Promise</code>
reverse geocode a coordinate. Can centered on a location or within a bounding box

**Kind**: global function  
**Returns**: <code>Promise</code> - returns [{},{}]  
**Params**

- opt <code>Object</code> - {query, bb or center}
    - .search <code>String</code> - text to search
    - .center <code>array</code> - [lat,lng]
    - .bb <code>object</code> - {latm,latM,lngm,lngM}

<a name="hm_getAvailableMapStyle"></a>

## hm:getAvailableMapStyle() ⇒ <code>json</code>
list of all available map styles normal.day, night....

**Kind**: global function  
**Returns**: <code>json</code> - list of map styles as json  
<a name="hm_getAvailableMapStyle"></a>

## hm:getAvailableMapStyle() ⇒ <code>json</code>
list of all available map styles normal.day, night....

**Kind**: global function  
**Returns**: <code>json</code> - list of map styles as json  
<a name="hm_getCenter"></a>

## hm:getCenter() ⇒ <code>coord</code>
return coordinate of the center of the map

**Kind**: global function  
**Returns**: <code>coord</code> - coord of the center as \[lat,lng\]  
<a name="hm_getCenter"></a>

## hm:getCenter() ⇒ <code>coord</code>
return coordinate of the center of the map

**Kind**: global function  
**Returns**: <code>coord</code> - coord of the center as \[lat,lng\]  
<a name="hm_getDefaultLayers"></a>

## hm:getDefaultLayers() ⇒ <code>object</code>
return default layers, created by _platform.createDefaultLayers();

**Kind**: global function  
**Returns**: <code>object</code> - defaultlayer  
<a name="hm_getDefaultLayers"></a>

## hm:getDefaultLayers() ⇒ <code>object</code>
return default layers, created by _platform.createDefaultLayers();

**Kind**: global function  
**Returns**: <code>object</code> - defaultlayer  
<a name="hm_getPlatform"></a>

## hm:getPlatform() ⇒ <code>object</code>
return platorm;

**Kind**: global function  
**Returns**: <code>object</code> - platform  
<a name="hm_getPlatform"></a>

## hm:getPlatform() ⇒ <code>object</code>
return platorm;

**Kind**: global function  
**Returns**: <code>object</code> - platform  
<a name="hm_getThrottleLimits"></a>

## hm:getThrottleLimits() ⇒ <code>string</code>
get Throttle limts for various modules

**Kind**: global function  
**Returns**: <code>string</code> - object with various limitsl  
<a name="hm_getThrottleLimits"></a>

## hm:getThrottleLimits() ⇒ <code>string</code>
get Throttle limts for various modules

**Kind**: global function  
**Returns**: <code>string</code> - object with various limitsl  
<a name="hm_getViewBB"></a>

## hm:getViewBB() ⇒ <code>Object</code>
return bounding box of visible part of map

**Kind**: global function  
**Returns**: <code>Object</code> - bouding box of visible part of the map, as \[latm,latM,longm,lngM\]  
<a name="hm_getViewBB"></a>

## hm:getViewBB() ⇒ <code>Object</code>
return bounding box of visible part of map

**Kind**: global function  
**Returns**: <code>Object</code> - bouding box of visible part of the map, as \[latm,latM,longm,lngM\]  
<a name="hm_getZoom"></a>

## hm:getZoom() ⇒ <code>number</code>
return zoom value

**Kind**: global function  
**Returns**: <code>number</code> - zoom level  
<a name="hm_getZoom"></a>

## hm:getZoom() ⇒ <code>number</code>
return zoom value

**Kind**: global function  
**Returns**: <code>number</code> - zoom level  
<a name="hm_htmlBounding"></a>

## hm:htmlBounding() ⇒ <code>object</code>
provide bounding box of element hosting map, relative to window

**Kind**: global function  
**Returns**: <code>object</code> - {top,left,width, height} relative to window  
<a name="hm_htmlBounding"></a>

## hm:htmlBounding() ⇒ <code>object</code>
provide bounding box of element hosting map, relative to window

**Kind**: global function  
**Returns**: <code>object</code> - {top,left,width, height} relative to window  
<a name="hm_isoline"></a>

## hm:isoline(opt) ⇒ <code>Promise</code>
compute an isoline. [See more info on optional parameters](http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer's%20Guide.pdf)

**Kind**: global function  
**Returns**: <code>Promise</code> - returns { poly:array, body:object }. Poly is array of coords, body is full answer  
**Params**

- opt <code>object</code> - option for isoline
    - [.start] <code>coord</code> - coord for starting point of isoline
    - [.destination] <code>coord</code> - coord for destination point of isoline
    - [.rangeType] <code>string</code> <code> = &quot;\&quot;time\&quot;&quot;</code> - time or distance
    - [.range] <code>number</code> - range in seconds or in meters
    - [.mode] <code>String</code> <code> = &quot;fastest;car;traffic:disabled&quot;</code> - routing mode
    - [.linkattributes] <code>String</code> <code> = sh</code> - attributes to be returned

<a name="hm_isoline"></a>

## hm:isoline(opt) ⇒ <code>Promise</code>
compute an isoline. [See more info on optional parameters](http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer's%20Guide.pdf)

**Kind**: global function  
**Returns**: <code>Promise</code> - returns { poly:array, body:object }. Poly is array of coords, body is full answer  
**Params**

- opt <code>object</code> - option for isoline
    - [.start] <code>coord</code> - coord for starting point of isoline
    - [.destination] <code>coord</code> - coord for destination point of isoline
    - [.rangeType] <code>string</code> <code> = &quot;\&quot;time\&quot;&quot;</code> - time or distance
    - [.range] <code>number</code> - range in seconds or in meters
    - [.mode] <code>String</code> <code> = &quot;fastest;car;traffic:disabled&quot;</code> - routing mode
    - [.linkattributes] <code>String</code> <code> = sh</code> - attributes to be returned

<a name="hm_layerCreate"></a>

## hm:layerCreate(name, visible)
create a layer

**Kind**: global function  
**Params**

- name <code>string</code> - name of layer
- visible <code>boolean</code> - initial status

**Example**  
```js
hm.layerCreate("layer1");
 ```
<a name="hm_layerCreate"></a>

## hm:layerCreate(name, visible)
create a layer

**Kind**: global function  
**Params**

- name <code>string</code> - name of layer
- visible <code>boolean</code> - initial status

**Example**  
```js
hm.layerCreate("layer1");
 ```
<a name="hm_layerDelete"></a>

## hm:layerDelete(name)
delete a layer

**Kind**: global function  
**Params**

- name <code>String</code> - name of layer

<a name="hm_layerDelete"></a>

## hm:layerDelete(name)
delete a layer

**Kind**: global function  
**Params**

- name <code>String</code> - name of layer

<a name="hm_layerEmpty"></a>

## hm:layerEmpty(layer)
Empty a layer, or create it if not existing

**Kind**: global function  
**Params**

- layer <code>string</code>

<a name="hm_layerEmpty"></a>

## hm:layerEmpty(layer)
Empty a layer, or create it if not existing

**Kind**: global function  
**Params**

- layer <code>string</code>

<a name="hm_layerFind"></a>

## hm:layerFind(name)
find layer by its name or return null

**Kind**: global function  
**Params**

- name <code>string</code>

<a name="hm_layerFind"></a>

## hm:layerFind(name)
find layer by its name or return null

**Kind**: global function  
**Params**

- name <code>string</code>

<a name="hm_layerSetVisibility"></a>

## hm:layerSetVisibility(name, visible)
create a layer

**Kind**: global function  
**Params**

- name <code>string</code> - name of layer
- visible <code>boolean</code> - visible or not

**Example**  
```js
hm.layerVisible("layer1",true);
 ```
<a name="hm_layerSetVisibility"></a>

## hm:layerSetVisibility(name, visible)
create a layer

**Kind**: global function  
**Params**

- name <code>string</code> - name of layer
- visible <code>boolean</code> - visible or not

**Example**  
```js
hm.layerVisible("layer1",true);
 ```
<a name="hm_linkid"></a>

## hm:linkid(linkid) ⇒ <code>Promise</code>
get linkid Information, based on routing

**Kind**: global function  
**Returns**: <code>Promise</code> - - promise with {summary, coords, route ,body}  
**Params**

- linkid <code>int</code> - linkid for which information is needed

<a name="hm_linkid"></a>

## hm:linkid(linkid) ⇒ <code>Promise</code>
get linkid Information, based on routing

**Kind**: global function  
**Returns**: <code>Promise</code> - - promise with {summary, coords, route ,body}  
**Params**

- linkid <code>int</code> - linkid for which information is needed

<a name="hm_locateMe"></a>

## hm:locateMe(callback, opt)
watch position on HTML5 position. This requires HTTPS. Creates layer "_gps". To deactivate, call with null callback

**Kind**: global function  
**Params**

- callback <code>function</code> - callback when coord changes. Format: callback(coord,accuracy)
- opt <code>Object</code> - optional graphic options
    - [.position] <code>object</code> - graphic options for center. See buildIcon
        - [.svg] <code>string</code> - svg file
        - [.color] <code>string</code> - color for  {color} tag
        - [.size] <code>number</code> - size of icon
        - [.anchor] <code>number</code> - anchor of icon
    - [.accuracy] <code>object</code> - graphic options for accuracy representation
        - [.strokeColor] <code>String</code> - color of circle line representing accuracy area
        - [.lineWidth] <code>number</code> - width of line of circle
        - [.fillColor] <code>String</code> - fill color of circle representing accuracy area

<a name="hm_locateMe"></a>

## hm:locateMe(callback, opt)
watch position on HTML5 position. This requires HTTPS. Creates layer "_gps". To deactivate, call with null callback

**Kind**: global function  
**Params**

- callback <code>function</code> - callback when coord changes. Format: callback(coord,accuracy)
- opt <code>Object</code> - optional graphic options
    - [.position] <code>object</code> - graphic options for center. See buildIcon
        - [.svg] <code>string</code> - svg file
        - [.color] <code>string</code> - color for  {color} tag
        - [.size] <code>number</code> - size of icon
        - [.anchor] <code>number</code> - anchor of icon
    - [.accuracy] <code>object</code> - graphic options for accuracy representation
        - [.strokeColor] <code>String</code> - color of circle line representing accuracy area
        - [.lineWidth] <code>number</code> - width of line of circle
        - [.fillColor] <code>String</code> - fill color of circle representing accuracy area

<a name="hm_map"></a>

## hm:map(htmlItem, opt)
create a map area within the specified item

**Kind**: global function  
**Params**

- htmlItem <code>string</code> - identifier of html div item on which to insert map
- opt <code>object</code> - options
    - [.zoom] <code>number</code> <code> = 10</code> - zoom factor
    - [.center] <code>Coord</code> <code> = [48.86, 2.3]</code> - Coord of the center
    - [.scheme] <code>string</code> <code> = &quot;normal.day.grey&quot;</code> - any scheme defined by HERE, plus "satellite", "japan", "korea", "black", "white", "transparent". For japan/korea, one needs special credentials as APP_ID_JAPAN APP_KOREA APP_CODE_JAPAN APP_CODE_KOREA
    - [.click] <code>function</code> - callback on mouse click: callback(coord,button,key)
    - [.dbClick] <code>function</code> - callback on mouse double click: callback(coord,button,key)
    - [.clickLeft] <code>function</code> - callback on mouse click left: callback(coord,button,key)
    - [.clickRight] <code>function</code> - callback on mouse click right.: callback(coord,button,key)
    - [.keyDown] <code>function</code> - callback on key down : callback(key)
    - [.viewChange] <code>function</code> - callback if map is panned or zoomed : callback(zoom,coordCenter)
    - [.loadTile] <code>function</code> - callback when a tile is loaded : callback(z,x,y,url)
    - [.rendered] <code>function</code> - callback when render is completed : callback(event)

**Example**  
```js
const hm = window.heremap;

hm.config({
   app_id: "YOUR APP_ID",
   app_code: "YOUR APP_CODE",
});

hm.map("map", {
   zoom:5,
   center: [48.8,2.3],
   click: function(coord,button,key) {console.log("clicked on",coord,"with button",button);}
});
 ```
<a name="hm_map"></a>

## hm:map(htmlItem, opt)
create a map area within the specified item

**Kind**: global function  
**Params**

- htmlItem <code>string</code> - identifier of html div item on which to insert map
- opt <code>object</code> - options
    - [.zoom] <code>number</code> <code> = 10</code> - zoom factor
    - [.center] <code>Coord</code> <code> = [48.86, 2.3]</code> - Coord of the center
    - [.scheme] <code>string</code> <code> = &quot;normal.day.grey&quot;</code> - any scheme defined by HERE, plus "satellite", "japan", "korea", "black", "white", "transparent". For japan/korea, one needs special credentials as APP_ID_JAPAN APP_KOREA APP_CODE_JAPAN APP_CODE_KOREA
    - [.click] <code>function</code> - callback on mouse click: callback(coord,button,key)
    - [.dbClick] <code>function</code> - callback on mouse double click: callback(coord,button,key)
    - [.clickLeft] <code>function</code> - callback on mouse click left: callback(coord,button,key)
    - [.clickRight] <code>function</code> - callback on mouse click right.: callback(coord,button,key)
    - [.keyDown] <code>function</code> - callback on key down : callback(key)
    - [.viewChange] <code>function</code> - callback if map is panned or zoomed : callback(zoom,coordCenter)
    - [.loadTile] <code>function</code> - callback when a tile is loaded : callback(z,x,y,url)
    - [.rendered] <code>function</code> - callback when render is completed : callback(event)

**Example**  
```js
const hm = window.heremap;

hm.config({
   app_id: "YOUR APP_ID",
   app_code: "YOUR APP_CODE",
});

hm.map("map", {
   zoom:5,
   center: [48.8,2.3],
   click: function(coord,button,key) {console.log("clicked on",coord,"with button",button);}
});
 ```
<a name="hm_marker"></a>

## hm:marker(opt) ⇒ <code>H.map.Marker</code>
add a marker in a layer. SVG files can be created with https://editor.method.ac/

**Kind**: global function  
**Returns**: <code>H.map.Marker</code> - marker created  
**Params**

- opt <code>object</code> - options to create the marker, can be a coord directly
    - [.layer] <code>string</code> - layer name
    - [.coord] <code>coord</code> - coord of the marker as \[lat,lng\]
    - [.icon] <code>string</code> - created from hm.buildIcon
    - [.svg] <code>string</code> - see hm.buildIcon
    - [.opt] <code>Object</code> - see hm.buildIcon
    - .pointerenter <code>function</code> - if enter, callback(target,coord,ev)
    - .pointerClick <code>function</code> - if click, callback(target,coord,ev)
    - .data <code>string</code> - optional data
    - .bubble <code>boolean</code> - if true, show buble on click with data
    - .draggable <code>boolean</code> - draggable marker
    - .dragged <code>function</code> - if dragged, callback(target,coord)

**Example**  
```js
hm.marker([48.8,2.3]);

hm.marker({
   coord: [48.8,2.3],
});

hm.marker({
  svg: "svg/marker.svg",
  color:"red",
  ratio:0.5
});

hm.marker({
   img: "http://whatever.com/image.png",
   coord: [48.8,2.3]
});

hm.marker({
   coord: [48.8,2.3],
   data:"Hello world",
   bubble: true
});

hm.marker({
   coord: [48.8,2.3],
   draggable:true,
   dragged: function(target,coord) {console.log("dragged to",coord);}
});
 ```
<a name="hm_marker"></a>

## hm:marker(opt) ⇒ <code>H.map.Marker</code>
add a marker in a layer. SVG files can be created with https://editor.method.ac/

**Kind**: global function  
**Returns**: <code>H.map.Marker</code> - marker created  
**Params**

- opt <code>object</code> - options to create the marker, can be a coord directly
    - [.layer] <code>string</code> - layer name
    - [.coord] <code>coord</code> - coord of the marker as \[lat,lng\]
    - [.icon] <code>string</code> - created from hm.buildIcon
    - [.svg] <code>string</code> - see hm.buildIcon
    - [.opt] <code>Object</code> - see hm.buildIcon
    - .pointerenter <code>function</code> - if enter, callback(target,coord,ev)
    - .pointerClick <code>function</code> - if click, callback(target,coord,ev)
    - .data <code>string</code> - optional data
    - .bubble <code>boolean</code> - if true, show buble on click with data
    - .draggable <code>boolean</code> - draggable marker
    - .dragged <code>function</code> - if dragged, callback(target,coord)

**Example**  
```js
hm.marker([48.8,2.3]);

hm.marker({
   coord: [48.8,2.3],
});

hm.marker({
  svg: "svg/marker.svg",
  color:"red",
  ratio:0.5
});

hm.marker({
   img: "http://whatever.com/image.png",
   coord: [48.8,2.3]
});

hm.marker({
   coord: [48.8,2.3],
   data:"Hello world",
   bubble: true
});

hm.marker({
   coord: [48.8,2.3],
   draggable:true,
   dragged: function(target,coord) {console.log("dragged to",coord);}
});
 ```
<a name="hm_matrix"></a>

## hm:matrix(source, dest, opt) ⇒ <code>Promise</code>
compute a matrix. [See more info on optional parameters](http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer's%20Guide.pdf)

Matrix size is limited to 1x100, 100x1 or 15xN

**Kind**: global function  
**Returns**: <code>Promise</code> - { entries: object, body:object }. entries is the array of {start,stop} information. body is full json answer  
**Params**

- source <code>object</code> - source as \[lat,lng\]. Can be array of \[lat,lng\]
- dest <code>object</code> - dest as \[lat,lng\]. Can be array of \[lat,lng\]
- opt <code>object</code> - additional optional parameters like  mode, summaryAttributes
    - [.mode] <code>string</code> <code> = &quot;\&quot;fastest;car;traffic:enabled\&quot;&quot;</code> - routing mode to compute matrix
    - [.summaryAttributes] <code>string</code> <code> = &quot;\&quot;tt,di\&quot;&quot;</code> - attributes in the answer

**Example**  
```js
const res = await hm.matrix(
     [48.8,2.3],
     [[48.7,2.5],[48.1,2.0],[44.2,2.3]]
);
console.log (res.entries); 
```
<a name="hm_matrix"></a>

## hm:matrix(source, dest, opt) ⇒ <code>Promise</code>
compute a matrix. [See more info on optional parameters](http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer's%20Guide.pdf)

Matrix size is limited to 1x100, 100x1 or 15xN

**Kind**: global function  
**Returns**: <code>Promise</code> - { entries: object, body:object }. entries is the array of {start,stop} information. body is full json answer  
**Params**

- source <code>object</code> - source as \[lat,lng\]. Can be array of \[lat,lng\]
- dest <code>object</code> - dest as \[lat,lng\]. Can be array of \[lat,lng\]
- opt <code>object</code> - additional optional parameters like  mode, summaryAttributes
    - [.mode] <code>string</code> <code> = &quot;\&quot;fastest;car;traffic:enabled\&quot;&quot;</code> - routing mode to compute matrix
    - [.summaryAttributes] <code>string</code> <code> = &quot;\&quot;tt,di\&quot;&quot;</code> - attributes in the answer

**Example**  
```js
const res = await hm.matrix(
     [48.8,2.3],
     [[48.7,2.5],[48.1,2.0],[44.2,2.3]]
);
console.log (res.entries); 
```
<a name="hm_placeAutoSuggest"></a>

## hm:placeAutoSuggest(opt) ⇒ <code>Promise</code>
Autocomplete of Places (POI). Can be centered on a locaiton or within a bounding box

**Kind**: global function  
**Returns**: <code>Promise</code> - Array of {res,title,value,coord}  
**Params**

- opt <code>Object</code> - options of autosuggest
    - .search <code>String</code> - search string
    - .center <code>Coord</code> - center search around this coord
    - .bb <code>object</code> - {latm,latM,lngm,lngM}

<a name="hm_placeAutoSuggest"></a>

## hm:placeAutoSuggest(opt) ⇒ <code>Promise</code>
Autocomplete of Places (POI). Can be centered on a locaiton or within a bounding box

**Kind**: global function  
**Returns**: <code>Promise</code> - Array of {res,title,value,coord}  
**Params**

- opt <code>Object</code> - options of autosuggest
    - .search <code>String</code> - search string
    - .center <code>Coord</code> - center search around this coord
    - .bb <code>object</code> - {latm,latM,lngm,lngM}

<a name="hm_placeExplore"></a>

## hm:placeExplore(opt, categories) ⇒ <code>array</code>
Discover places (POI) around a coordnate belonging to a list of categories

**Kind**: global function  
**Returns**: <code>array</code> - array of {id,title,icon}  
**Params**

- opt <code>object</code> - option for search
    - .at <code>array</code> - center of search
    - .size <code>int</code> - number of result to return
- categories <code>text</code> - list of comma separated categories for post-filtering

<a name="hm_placeExplore"></a>

## hm:placeExplore(opt, categories) ⇒ <code>array</code>
Discover places (POI) around a coordnate belonging to a list of categories

**Kind**: global function  
**Returns**: <code>array</code> - array of {id,title,icon}  
**Params**

- opt <code>object</code> - option for search
    - .at <code>array</code> - center of search
    - .size <code>int</code> - number of result to return
- categories <code>text</code> - list of comma separated categories for post-filtering

<a name="hm_placeGetCategory"></a>

## hm:placeGetCategory(center) ⇒ <code>promise</code>
Get Categories of Places (POI)

**Kind**: global function  
**Returns**: <code>promise</code> - array of {id,title,icon}  
**Params**

- center <code>array</code> - where to search for available categories

<a name="hm_placeGetCategory"></a>

## hm:placeGetCategory(center) ⇒ <code>promise</code>
Get Categories of Places (POI)

**Kind**: global function  
**Returns**: <code>promise</code> - array of {id,title,icon}  
**Params**

- center <code>array</code> - where to search for available categories

<a name="hm_placeSearch"></a>

## hm:placeSearch(opt, categories) ⇒ <code>promise</code>
Search for a Place (POI) around a coordinate matching a name

**Kind**: global function  
**Returns**: <code>promise</code> - array of {id,title,icon}  
**Params**

- opt <code>object</code> - option for search
    - .at <code>array</code> - center of search
    - .q <code>text</code> - name to search
    - .size <code>int</code> - number of result to return
- categories <code>text</code> - list of comma separated categories for post-filtering

<a name="hm_placeSearch"></a>

## hm:placeSearch(opt, categories) ⇒ <code>promise</code>
Search for a Place (POI) around a coordinate matching a name

**Kind**: global function  
**Returns**: <code>promise</code> - array of {id,title,icon}  
**Params**

- opt <code>object</code> - option for search
    - .at <code>array</code> - center of search
    - .q <code>text</code> - name to search
    - .size <code>int</code> - number of result to return
- categories <code>text</code> - list of comma separated categories for post-filtering

<a name="hm_point2Coord"></a>

## hm:point2Coord({lat,lng}) ⇒ <code>array</code>
Convert {lat,lng} to [lat,lng]

**Kind**: global function  
**Returns**: <code>array</code> - [lat,lng]  - array converted  
**Params**

- {lat,lng} <code>object</code> - object to convert

<a name="hm_point2Coord"></a>

## hm:point2Coord({lat,lng}) ⇒ <code>array</code>
Convert {lat,lng} to [lat,lng]

**Kind**: global function  
**Returns**: <code>array</code> - [lat,lng]  - array converted  
**Params**

- {lat,lng} <code>object</code> - object to convert

<a name="hm_polygon"></a>

## hm:polygon(opt)
Draw a polygon

**Kind**: global function  
**Params**

- opt <code>Object</code> - options to draw a polygon. Same options as hm.polyline

<a name="hm_polygon"></a>

## hm:polygon(opt)
Draw a polygon

**Kind**: global function  
**Params**

- opt <code>Object</code> - options to draw a polygon. Same options as hm.polyline

<a name="hm_polyline"></a>

## hm:polyline(opt)
Draw a polyline.

**Kind**: global function  
**Params**

- opt <code>object</code> - options to draw polyline
    - [.layer] <code>String</code> - optional layer to use
    - [.coords] <code>array</code> - array of coords, as \[\[48.8,2.3\],\[48.85,2.4\],... \]
    - [.style] <code>object</code> - optional graphic style
    - [.lineWidth] <code>number</code> <code> = 4</code> - line width
        - [.strokeColor] <code>string</code> <code> = &quot;rgba(0, 128, 255, 0.7)&quot;</code> - line color
    - [.arrows] <code>object</code> - optional arrow
    - [.data] <code>String</code> - optional user data
    - [.pointerClick] <code>function</code> - optional callback if click on line. format callback(target,coord,event)
    - [.pointerenter] <code>function</code> - optional callback if mouse enters on line. format callback(target,coord,event)
    - [.pointerLeave] <code>function</code> - optional callback if mouse leaves the line. format callback(target,coord,event)
    - [.z] <code>number</code> - optional z level
```js
hm.polyline({
   coords: [[48.8,2.3],[48.85,2.4],[48.9,2.6]],
   layer:"layer1"
});

hm.polyline({
   coords: coords,
   style: {
       lineWidth: 4,
       strokeColor: "red"
   },
});

hm.polyline({
   coords: coords,
   data:"Hello World",
});
 ```

<a name="hm_polyline"></a>

## hm:polyline(opt)
Draw a polyline.

**Kind**: global function  
**Params**

- opt <code>object</code> - options to draw polyline
    - [.layer] <code>String</code> - optional layer to use
    - [.coords] <code>array</code> - array of coords, as \[\[48.8,2.3\],\[48.85,2.4\],... \]
    - [.style] <code>object</code> - optional graphic style
    - [.lineWidth] <code>number</code> <code> = 4</code> - line width
        - [.strokeColor] <code>string</code> <code> = &quot;rgba(0, 128, 255, 0.7)&quot;</code> - line color
    - [.arrows] <code>object</code> - optional arrow
    - [.data] <code>String</code> - optional user data
    - [.pointerClick] <code>function</code> - optional callback if click on line. format callback(target,coord,event)
    - [.pointerenter] <code>function</code> - optional callback if mouse enters on line. format callback(target,coord,event)
    - [.pointerLeave] <code>function</code> - optional callback if mouse leaves the line. format callback(target,coord,event)
    - [.z] <code>number</code> - optional z level
```js
hm.polyline({
   coords: [[48.8,2.3],[48.85,2.4],[48.9,2.6]],
   layer:"layer1"
});

hm.polyline({
   coords: coords,
   style: {
       lineWidth: 4,
       strokeColor: "red"
   },
});

hm.polyline({
   coords: coords,
   data:"Hello World",
});
 ```

<a name="hm_reverseGeocode"></a>

## hm:reverseGeocode(coord) ⇒ <code>Promise</code>
reverse geocode a coordinate

**Kind**: global function  
**Returns**: <code>Promise</code> - returns { location:object, address:object, body:object}.  
**Params**

- coord <code>Coord</code> - coord \[lat,lng\] to reverse-geocode

<a name="hm_reverseGeocode"></a>

## hm:reverseGeocode(coord) ⇒ <code>Promise</code>
reverse geocode a coordinate

**Kind**: global function  
**Returns**: <code>Promise</code> - returns { location:object, address:object, body:object}.  
**Params**

- coord <code>Coord</code> - coord \[lat,lng\] to reverse-geocode

<a name="hm_route"></a>

## hm:route(source, dest, opt) ⇒ <code>Promise</code>
compute a route with optional waypooints. [See more info on optional parameters](http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer's%20Guide.pdf)

**Kind**: global function  
**Returns**: <code>Promise</code> - returns { summary: object, coords:array,route: object, body:object}. coords is array of coord, to be used with hm.polyline.  
**Params**

- source <code>object</code> - source as \[lat,lng\]. Can be array of \[lat,lng\] to define waypoints
- dest <code>object</code> - dest as \[lat,lng\]. Can be array of \[lat,lng\] to define waypoints
- opt <code>object</code> - route options
    - [.mode] <code>string</code> <code> = &quot;fastest;car;traffic:disabled&quot;</code> - routing mode
    - [.routeattributes] <code>string</code> <code> = &quot;waypoints,summary,shape&quot;</code> - route attributes
    - [.maneuverattributes] <code>string</code> <code> = &quot;direction,action&quot;</code> - manoeuver attributes

**Example**  
```js
const res = await hm.route([48.8,2.3],[48.7,2.5]);
console.log (res.summary);

const res = await hm.route([[48.8,2.3],[48.9,2.7]], [49.3,2.5]);
console.log (res.route); 

const res = await hm.route([48.8,2.3], [[48.9,2.7], [49.3,2.5]]);
console.log (res.summary); 
```
<a name="hm_route"></a>

## hm:route(source, dest, opt) ⇒ <code>Promise</code>
compute a route with optional waypooints. [See more info on optional parameters](http://documentation.developer.here.com/pdf/routing_hlp/7.2.100/Routing%20API%20v7.2.100%20Developer's%20Guide.pdf)

**Kind**: global function  
**Returns**: <code>Promise</code> - returns { summary: object, coords:array,route: object, body:object}. coords is array of coord, to be used with hm.polyline.  
**Params**

- source <code>object</code> - source as \[lat,lng\]. Can be array of \[lat,lng\] to define waypoints
- dest <code>object</code> - dest as \[lat,lng\]. Can be array of \[lat,lng\] to define waypoints
- opt <code>object</code> - route options
    - [.mode] <code>string</code> <code> = &quot;fastest;car;traffic:disabled&quot;</code> - routing mode
    - [.routeattributes] <code>string</code> <code> = &quot;waypoints,summary,shape&quot;</code> - route attributes
    - [.maneuverattributes] <code>string</code> <code> = &quot;direction,action&quot;</code> - manoeuver attributes

**Example**  
```js
const res = await hm.route([48.8,2.3],[48.7,2.5]);
console.log (res.summary);

const res = await hm.route([[48.8,2.3],[48.9,2.7]], [49.3,2.5]);
console.log (res.route); 

const res = await hm.route([48.8,2.3], [[48.9,2.7], [49.3,2.5]]);
console.log (res.summary); 
```
<a name="hm_screenshot"></a>

## hm:screenshot(opt, opt) ⇒ <code>data</code>
perform a screenshot of the map and returns a promise with the data

**Kind**: global function  
**Returns**: <code>data</code> - binary data of image  
**Params**

- opt <code>object</code> - options for screenshot
    - [.name] <code>string</code> - filename for download
    - [.ui] <code>boolean</code> - true to ui (scale, etc..) in screenshot
- opt <code>object</code> - options for screenshot

<a name="hm_screenshot"></a>

## hm:screenshot(opt, opt) ⇒ <code>data</code>
perform a screenshot of the map and returns a promise with the data

**Kind**: global function  
**Returns**: <code>data</code> - binary data of image  
**Params**

- opt <code>object</code> - options for screenshot
    - [.name] <code>string</code> - filename for download
    - [.ui] <code>boolean</code> - true to ui (scale, etc..) in screenshot
- opt <code>object</code> - options for screenshot

<a name="hm_setCenter"></a>

## hm:setCenter(coord)
set center of the map

**Kind**: global function  
**Params**

- coord <code>Array</code> - coord as [lat,lng]
* @example
```js
hm.setCenter([48.8,2.3]);
 ```

<a name="hm_setCenter"></a>

## hm:setCenter(coord)
set center of the map

**Kind**: global function  
**Params**

- coord <code>Array</code> - coord as [lat,lng]
* @example
```js
hm.setCenter([48.8,2.3]);
 ```

<a name="hm_setScheme"></a>

## hm:setScheme(scheme)
define the scheme. List of scheme can be obtained from hm.getAvailableMapStyle()

**Kind**: global function  
**Params**

- scheme <code>string</code> - scheme name

<a name="hm_setScheme"></a>

## hm:setScheme(scheme)
define the scheme. List of scheme can be obtained from hm.getAvailableMapStyle()

**Kind**: global function  
**Params**

- scheme <code>string</code> - scheme name

<a name="hm_setViewBB"></a>

## hm:setViewBB(opt)
sets bouding box to be displayed

**Kind**: global function  
**Params**

- opt <code>Object</code> | <code>string</code> - either an object specifying how to set bounding box, or  a String being the name of a layer
    - [.layer] <code>string</code> - bouding box aroud all objects of the layer
    - [.pois] <code>array</code> - bouding box aroud all coords defined as \[coord,coord...\]

**Example**  
```js
hm.setViewBB("layer1");

hm.setViewBB({
   pois: coords
});
 ```
<a name="hm_setViewBB"></a>

## hm:setViewBB(opt)
sets bouding box to be displayed

**Kind**: global function  
**Params**

- opt <code>Object</code> | <code>string</code> - either an object specifying how to set bounding box, or  a String being the name of a layer
    - [.layer] <code>string</code> - bouding box aroud all objects of the layer
    - [.pois] <code>array</code> - bouding box aroud all coords defined as \[coord,coord...\]

**Example**  
```js
hm.setViewBB("layer1");

hm.setViewBB({
   pois: coords
});
 ```
<a name="hm_setZoom"></a>

## hm:setZoom(zoom)
set zoom level

**Kind**: global function  
**Params**

- zoom <code>number</code>

<a name="hm_setZoom"></a>

## hm:setZoom(zoom)
set zoom level

**Kind**: global function  
**Params**

- zoom <code>number</code>

<a name="hm_simplify"></a>

## hm:simplify(coords, tolerance) ⇒ <code>array</code>
Simplify a polyline by using the Ramer-Douglas-Peucker algorithm

**Kind**: global function  
**Returns**: <code>array</code> - simplified polyline as array of [lat,lng]  
**Params**

- coords <code>array</code> - array of [lat,lng]
- tolerance <code>number</code> - tolerance for simplification

<a name="hm_simplify"></a>

## hm:simplify(coords, tolerance) ⇒ <code>array</code>
Simplify a polyline by using the Ramer-Douglas-Peucker algorithm

**Kind**: global function  
**Returns**: <code>array</code> - simplified polyline as array of [lat,lng]  
**Params**

- coords <code>array</code> - array of [lat,lng]
- tolerance <code>number</code> - tolerance for simplification

<a name="hm_tile2BB"></a>

## hm:tile2BB(tileX, tileY, level) ⇒ <code>Object</code>
compute the bounding box of a Tile

**Kind**: global function  
**Returns**: <code>Object</code> - - {latm,latM,lngm,lngM}  
**Params**

- tileX <code>int</code> - X coord of the tile
- tileY <code>int</code> - Y coord of the tile
- level <code>int</code> - zoom level

<a name="hm_tile2BB"></a>

## hm:tile2BB(tileX, tileY, level) ⇒ <code>Object</code>
compute the bounding box of a Tile

**Kind**: global function  
**Returns**: <code>Object</code> - - {latm,latM,lngm,lngM}  
**Params**

- tileX <code>int</code> - X coord of the tile
- tileY <code>int</code> - Y coord of the tile
- level <code>int</code> - zoom level

<a name="hm_touch"></a>

## hm:touch(onoff, options)
activate touch, allowing hand drawing, with embedded simplification of the line

**Kind**: global function  
**Params**

- onoff <code>boolean</code> - activate or deactivate
- options <code>object</code> - options  to control the touch behaviour
    - [.callback] <code>function</code> - calling callback(coords) when touch ends
    - [.layer] <code>string</code> - layer where to put the drawing
    - [.style] <code>object</code> - drawing style for the line
    - [.arrows] <code>object</code> - arrow style for the line
    - [.tolerance] <code>number</code> <code> = 4</code> - tolerance for simplification
    - [.keep] <code>boolean</code> <code> = false</code> - keep graphic or not when calling callback

<a name="hm_touch"></a>

## hm:touch(onoff, options)
activate touch, allowing hand drawing, with embedded simplification of the line

**Kind**: global function  
**Params**

- onoff <code>boolean</code> - activate or deactivate
- options <code>object</code> - options  to control the touch behaviour
    - [.callback] <code>function</code> - calling callback(coords) when touch ends
    - [.layer] <code>string</code> - layer where to put the drawing
    - [.style] <code>object</code> - drawing style for the line
    - [.arrows] <code>object</code> - arrow style for the line
    - [.tolerance] <code>number</code> <code> = 4</code> - tolerance for simplification
    - [.keep] <code>boolean</code> <code> = false</code> - keep graphic or not when calling callback

<a name="hm_xy2Coords"></a>

## hm:xy2Coords(coords) ⇒ <code>array</code>
Convert array of {x,y} to array of [lat,lng]

**Kind**: global function  
**Returns**: <code>array</code> - array of [lat,lng]  
**Params**

- coords <code>array</code> - array of {x,y}

<a name="hm_xy2Coords"></a>

## hm:xy2Coords(coords) ⇒ <code>array</code>
Convert array of {x,y} to array of [lat,lng]

**Kind**: global function  
**Returns**: <code>array</code> - array of [lat,lng]  
**Params**

- coords <code>array</code> - array of {x,y}

<a name="lineIntersects"></a>

## lineIntersects(A, B, C, D)
**Kind**: global function  
**Params**

- A <code>\*</code>
- B <code>\*</code>
- C <code>\*</code>
- D <code>\*</code>

<a name="marker_getCoord"></a>

## marker:getCoord() ⇒ <code>coord</code>
get coordinates of a marker

**Kind**: global function  
**Returns**: <code>coord</code> - [lat,lng]  
**Example**  
```js
let m =hm.marker([48.8,2.3]);

let coord = m.getcoord(); // returns [48.8,2.3]

 ```
<a name="marker_getCoord"></a>

## marker:getCoord() ⇒ <code>coord</code>
get coordinates of a marker

**Kind**: global function  
**Returns**: <code>coord</code> - [lat,lng]  
**Example**  
```js
let m =hm.marker([48.8,2.3]);

let coord = m.getcoord(); // returns [48.8,2.3]

 ```
<a name="stringify"></a>

## stringify()
Stringifies a GeoJSON object into WKT

**Kind**: global function  

* * *

&copy; 2018-2019 devbab