- Version
- 0.37.1
Methods
(static) addFeatures(features)
Name | Type | Description |
---|---|---|
features | Features | Object containing the features to be added. |
Add a point annotation.
map.addFeatures({
geoJson: [{
type: "Feature",
geometry: {
type: "Point",
coordinates: [-122.126986, 47.639754],
},
}],
});
(static) enableMeasurementPanel(enabled, callbackopt)
Name | Type | Attributes | Description |
---|---|---|---|
enabled | boolean | True to enable the measurement panel, false to disable. | |
callback | function | <optional> | Called after successfully disabling toggling the measurement panel. |
map.enableMeasurementPanel(false, () => console.log('Measurement panel disabled'));
(static) enableSearchBar(enabled, callbackopt)
Name | Type | Attributes | Description |
---|---|---|---|
enabled | boolean | True to enable the search bar, false to disable. | |
callback | function | <optional> | Called after successfully toggling the search bar. |
map.enableSearchBar(false, () => console.log('Search bar disabled'));
(static) getAppVersion() → {string}
- Type:
- string
// returns 1.0.0
map.getAppVersion();
(static) getFeatures() → {Features}
- Type:
- Features
Retrieve all the feature.
map.getFeatures();
(static) getLayers() → {Array.<Layer>}
- Type:
- Array.<Layer>
example of getLayers api response:
[{
id: 3680,
groupId: 1,
groupName: 'Group1',
name: 'AAA_polygon_web_hook',
visible: false
},
{
id: 3681,
groupId: 1,
groupName: 'Group1',
name: 'web_hook',
visible: false
}]
map.getLayers();
map.on('onLayersDataLoad', (layerData)=>{ console.log('Layer results:',layerData)});
(static) layerSearch(searchObject, callbackopt)
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
searchObject | Object | Search parameters.Properties
| |||||||||||||||||
callback | function | <optional> | (features) => {} callback function returns a GeoJSON feature collection and the response format will be like { features: [ { geometry: { coordinates: [], type: '' }, properties: {}, type: '', } ] } |
LayerSearch with event listener
map.on('layerSearch', (features)=>{ console.log('Layer search results:',features)});
map.layerSearch({ id: 3598, searchString: '15', searchProperties:['apn', 'object_id'] });
LayerSearch with callback function
map.layerSearch({ id: 3263, searchString: '15', searchProperties:['address'] }, (features)=>{console.log(features)});
example of layersearch api response:
{ features: [
{
"id": 123456,
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[-119.10137799599994, 38.364409468000076],
[-119.09784600699999, 38.36741644700004],
[-119.09938722199996, 38.368532781000056],
[-119.10291920199995, 38.36552575700006],
[-119.10137799599994, 38.364409468000076]
]
},
"properties": {
"addr": null,
"apn": "15",
"apn2": "15",
}
},
]
}
(static) off(eventName)
Name | Type | Description |
---|---|---|
eventName | 'onViewUpdate' | | Name of event |
Stop handling onViewUpdate events.
map.off('onViewUpdate');
Stop handling layerSearch events.
map.off('layerSearch');
Stop handling Errors events.
map.off('Errors');
Stop handling onMapReady events.
map.off('onMapReady');
Stop handling onLayersDataLoad events.
map.off('onLayersDataLoad');
(static) on(eventName, listener)
An 'onViewUpdate' event is dispatched when a view change action has complete.
An 'featureClick' event is dispatched when annotations on the map are clicked. This will be a collection of features, as they may overlap. Features on top will be the first elements in the array
An 'Errors' event is dispatched when an error occurs within an API call.
An 'layerSearch' event is dispatched when layer search API return features.
An 'onMapReady' event is dispatched when map load complete and ready to use.
An 'onLayersDataLoad' event is dispatched when layers fetch API return layers and groups detail after load complete.
Name | Type | Description |
---|---|---|
eventName | 'onViewUpdate' | | Name of event |
listener | function | Listener handler function. |
Listening for the onViewUpdate event.
map.on('onViewUpdate', (updatedView) => {
console.log(`updated lat/lon: ${updatedView.lonLat.lat}, ${updatedView.lonLat.lon}`);
console.log(`updated zoom: ${updatedView.zoom}`);
console.log(`updated pitch: ${updatedView.pitch}`);
console.log(`updated rotation: ${updatedView.rotation}`);
});
Listening for the featureClick event.
map.on('featureClick', (features) => {
for (feature in features.geoJson) {
console.log(`Feature Clicked! ${feature.properties.eagleview.value`);
}
});
Listening for the layerSearch event.
map.on('layerSearch', (features) => {
console.log(`layer search features! ${features`);
});
Listening for the Errors event.
map.on('Errors', (error) => {
console.log(error);
});
Listening for the layer data loaded event.
map.on('onLayersDataLoad', (layerData) => {
console.log(layerData);
});
Listening for the map load complete event.
map.on('onMapReady', () => {
console.log(onMapReady);
});
(static) removeFeatures(featureFilters)
Name | Type | Description |
---|---|---|
featureFilters | FeatureFilters | Object containing filter functions for removing annotation features. |
Remove all added annotation features.
map.removeFeatures();
Remove all geoJson point features.
map.removeFeatures({ geoJson: (feature) => feature.geometry.type === "Point" })
(static) searchAddress(value)
Name | Type | Description |
---|---|---|
value | String | Address String. |
(static) setAuthToken(token)
Name | Type | Description |
---|---|---|
token | string | New auth token to use. |
map.setAuthToken('authToken');
(static) setLonLat(value, callbackopt)
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
value | Object | lonLat object {lon:, lat:}Properties
| |||||||||||||||||||||
callback | function | <optional> | Called after successfully setting lat lon. Receives the value passed to the function. For height above ellipsoidal(default) = zType: 'HEIGHT_REFERENCE_ELLIPSOIDAL' For height above orthometric = zType: 'HEIGHT_REFERENCE_ORTHOMETRIC' |
Navigate to and display address
map.setLonLat({ lat: 23, lon: 45 }, () => console.log(`Map location set`));
Navigate to and display address with z-axis drawing
map.setLonLat({ lat: 23, lon: 45, z:100 }, () => console.log(`Map location set`));
Navigate to and display address with z-axis drawing and zType option
map.setLonLat({ lat: 23, lon: 45, z:100, zType: 'HEIGHT_REFERENCE_ORTHOMETRIC' }, () => console.log(`Map location set`));
(static) setPitch(value, callbackopt)
Name | Type | Attributes | Description |
---|---|---|---|
value | number | Map pitch in degrees. The value is clamped to between 0 and 60. | |
callback | function | <optional> | Called after successfully setting pitch. Receives the updated view object. |
map.setPitch(10, () => console.log('Map pitch set'));
(static) setRotation(value, callbackopt)
Name | Type | Attributes | Description |
---|---|---|---|
value | number | Map rotation angle in degrees. | |
callback | function | <optional> | Called after successfully setting rotation. Receives the updated view object. |
map.setRotation(45, () => console.log('Map rotation set'));
(static) setView(value, callbackopt)
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
value | Object | View parameters.Properties
| |||||||||||||||||||||||||||||||||||||||||
callback | function | <optional> | (view) => {} Called after successfully setting the view. Receives the updated view object. For height above ellipsoidal(default) = zType: 'HEIGHT_REFERENCE_ELLIPSOIDAL' For height above orthometric = zType: 'HEIGHT_REFERENCE_ORTHOMETRIC' |
map.setView({ lonLat: {lat: 23, lon: 45}, zoom: 20, pitch: 15, rotation: -75 }, (value) => console.log('View has been set.'));
map.setView({ lonLat:{ lat: 23, lon: 45, z:100 }, zoom: 20, pitch: 15, rotation: -75}, (value) => console.log('View has been set.'));
map.setView({ lonLat:{ lat: 23, lon: 45, z:100, zType: 'HEIGHT_REFERENCE_ORTHOMETRIC' },
zoom: 20, pitch: 15, rotation: -75, }, (value) => console.log('View has been set.'));
(static) updateLayers(options)
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options | Object | Options objectProperties
|
Name | Type | Description |
---|---|---|
visible | Boolean if true the layer is made visible on the map, if false the layer is hidden |
map.updateLayers({
filter: (layer) => {
if (layer.id === 1234) {
layer.visible = true;
}
}
});
(static) zoomIn(valueopt, callbackopt)
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | number | <optional> | 1 | Steps to increase the zoom level by. |
callback | function | <optional> | Called after successfully zooming in. Receives the updated view object. |
map.zoomIn(2, () => console.log('Map zoom increased'));
(static) zoomOut(valueopt, callbackopt)
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value | number | <optional> | 1 | Steps to decrease the zoom level by. |
callback | function | <optional> | Called after successfully zooming out. Receives the updated view object. |
map.zoomOut(2, () => console.log('Map zoom decreased'));
Type Definitions
Features
- Object
Name | Type | Description |
---|---|---|
geoJson | Array.<GeoJsonFeature> | Array of GeoJson features that had been added to the application. |
Layer
- Object
Name | Type | Description |
---|---|---|
id | number | Layer id |
groupId | number | group id of layer |
groupName | string | group name of layer |
name | string | layer name |
visible | boolean | visibility of layer on the map |
{
id: 3680,
groupId: 1,
groupName: 'Group1',
name: 'AAA_polygon_web_hook',
visible: false
}