Class: LocalProvider

.xyz.maps.providers. LocalProvider

new LocalProvider(config)

Local provider
Parameters:
Name Type Description
config here.xyz.maps.providers.LocalProvider.Options configuration of the provider

Extends

Classes

Options

Members Summary

id :String

Provider id.

import :string

level :Integer

provider request tiles at this zoomlevel.

margin :Integer

default tile margin.

name :String

Provider name.

url :String

url for requesting tiles.

Methods Summary

addEventListener()

Add event listener to provider, valid events: "featureAdd", "featureRemove", "featureCoordinatesChange", "clear" and "error"

addFeature(feature) → {here.xyz.maps.providers.FeatureProvider.Feature|Array.<here.xyz.maps.providers.FeatureProvider.Feature>}

Adds a feature to layer.

all() → {Array.<here.xyz.maps.providers.FeatureProvider.Feature>}

Gets all features currently stored in provider.

clear(bbox)

Clear features in bounding box. clear all if bounding box is not given.

config(cfg) → {here.xyz.maps.providers.TileProvider}

set config for provider.

createTile(quadkey) → {here.xyz.maps.providers.TileProvider.Tile}

create tile.

exists(feature) → {here.xyz.maps.providers.FeatureProvider.Feature}

Validate if a feature is in cache, returns true if the object exists.

getCachedTile(quadkey) → {here.xyz.maps.providers.TileProvider.Tile}

get cached tile by quadkey.

getCachedTilesOfBBox(bbox, level) → {Array.<here.xyz.maps.providers.TileProvider.Tile>}

get cached tile by bounding box.

getFeature(id) → {here.xyz.maps.providers.FeatureProvider.Feature}

Gets a feature from provider.

getFeatures(ids) → {Array.<here.xyz.maps.providers.FeatureProvider.Feature>}

Gets features from provider layer.

removeEventListener()

Remove event listener from provider, valid events: "featureadd", "featureRemove", "featureCoordinatesChange", "clear" and "error"

removeFeature(feature)

Remove feature from layer provider.

search(options) → {Array.<here.xyz.maps.providers.FeatureProvider.Feature>}

Search for feature in provider.

setFeatureCoordinates(feature, coordinates)

Modify coordinates of a feature.

setMargin(margin)

set tile margin.

Members Details

id :String

Provider id.
Type:
String
Inherited From:

import :string

Type:
string

level :Integer

provider request tiles at this zoomlevel.
Type:
Integer
Inherited From:

margin :Integer

default tile margin.
Type:
Integer
Inherited From:

name :String

Provider name.
Type:
String
Inherited From:

url :String

url for requesting tiles.
Type:
String
Inherited From:

Methods Details

addEventListener()

Add event listener to provider, valid events: "featureAdd", "featureRemove", "featureCoordinatesChange", "clear" and "error"
Inherited From:

addFeature(feature) → {here.xyz.maps.providers.FeatureProvider.Feature|Array.<here.xyz.maps.providers.FeatureProvider.Feature>}

Adds a feature to layer.
Parameters:
Name Type Description
feature here.xyz.maps.providers.FeatureProvider.Feature | Array.<here.xyz.maps.providers.FeatureProvider.Feature>
Inherited From:
Returns:
feature
Type:
here.xyz.maps.providers.FeatureProvider.Feature | Array.<here.xyz.maps.providers.FeatureProvider.Feature>
Example:
provider.addFeature({
 geometry: {
     coordinates: [[-122.159958,37.76620, 0],[-122.169958,37.76620, 0]],
     type: "LineString"
 },
 type: "Feature"
})
 

all() → {Array.<here.xyz.maps.providers.FeatureProvider.Feature>}

Gets all features currently stored in provider.
Inherited From:
Returns:
Type:
Array.<here.xyz.maps.providers.FeatureProvider.Feature>

clear(bbox)

Clear features in bounding box. clear all if bounding box is not given.
Parameters:
Name Type Argument Description
bbox Array.<number> <optional>
bounding box array: [minLon, minLat, maxLon, maxLat]
Inherited From:

config(cfg) → {here.xyz.maps.providers.TileProvider}

set config for provider.
Parameters:
Name Type Description
cfg here.xyz.maps.providers.TileProvider.Options
Inherited From:
Returns:
Type:
here.xyz.maps.providers.TileProvider

createTile(quadkey) → {here.xyz.maps.providers.TileProvider.Tile}

create tile.
Parameters:
Name Type Description
quadkey String
Inherited From:
Returns:
created tile
Type:
here.xyz.maps.providers.TileProvider.Tile

exists(feature) → {here.xyz.maps.providers.FeatureProvider.Feature}

Validate if a feature is in cache, returns true if the object exists.
Parameters:
Name Type Description
feature Object Object literal containing "id" property.
Inherited From:
Returns:
return feature if it is found, otherwise undefined
Type:
here.xyz.maps.providers.FeatureProvider.Feature

getCachedTile(quadkey) → {here.xyz.maps.providers.TileProvider.Tile}

get cached tile by quadkey.
Parameters:
Name Type Description
quadkey String
Inherited From:
Returns:
Type:
here.xyz.maps.providers.TileProvider.Tile

getCachedTilesOfBBox(bbox, level) → {Array.<here.xyz.maps.providers.TileProvider.Tile>}

get cached tile by bounding box.
Parameters:
Name Type Argument Description
bbox Array.<Number> array of coordinates in order: [minLon, minLat, maxLon, maxLat]
level Integer <optional>
get tiles at specified level
Inherited From:
Returns:
array of tiles
Type:
Array.<here.xyz.maps.providers.TileProvider.Tile>

getFeature(id) → {here.xyz.maps.providers.FeatureProvider.Feature}

Gets a feature from provider.
Parameters:
Name Type Description
id string object id
Inherited From:
Returns:
Type:
here.xyz.maps.providers.FeatureProvider.Feature

getFeatures(ids) → {Array.<here.xyz.maps.providers.FeatureProvider.Feature>}

Gets features from provider layer.
Parameters:
Name Type Description
ids Array.<string> | string array of object ids
Inherited From:
Returns:
Type:
Array.<here.xyz.maps.providers.FeatureProvider.Feature>

removeEventListener()

Remove event listener from provider, valid events: "featureadd", "featureRemove", "featureCoordinatesChange", "clear" and "error"
Inherited From:

removeFeature(feature)

Remove feature from layer provider.
Parameters:
Name Type Description
feature here.xyz.maps.providers.FeatureProvider.Feature | Array.<here.xyz.maps.providers.FeatureProvider.Feature>
Inherited From:
Search for feature in provider.
Parameters:
Name Type Description
options Object
Properties
Name Type Argument Description
id String <optional>
Object id.
ids Array.<String> <optional>
Array of object ids.
point here.xyz.maps.geo.Point <optional>
Center point of the circle for search
radius number <optional>
Radius of the circle in meters, it is used in "point" search.
rect here.xyz.maps.geo.Rect | Array.<number> <optional>
Rect object is either an array: [minLon, minLat, maxLon, maxLat] or Rect object defining rectangle to search in.
Inherited From:
Returns:
array of features
Type:
Array.<here.xyz.maps.providers.FeatureProvider.Feature>
Examples:
//searching by id:
provider.search({id: 1058507462})
//or:
provider.search({ids: [1058507462, 1058507464]})
//searching by point and radius:
provider.search({
 point: {longitude: 72.84205, latitude: 18.97172},
 radius: 100
})
//searching by Rect:
provider.search({
 rect:  {minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876}
})
 

setFeatureCoordinates(feature, coordinates)

Modify coordinates of a feature.
Parameters:
Name Type Description
feature here.xyz.maps.providers.FeatureProvider.Feature
coordinates Array.<Array> | Array.<number> new coordinates of the feature, it is either array of coordinates: [longitude, latitude, z] or array of coordinate arrays: [ [longitude, latitude, z], [longitude, latitude, z], , , , ].
Inherited From:

setMargin(margin)

set tile margin.
Parameters:
Name Type Description
margin Integer in pixel
Inherited From: