Create OpenLayers Map, View, Layer etc. instances based on an iShare profile.
ESM example:
import * as imap from 'ol-ishare/map'
// All functions in the info module are accessible as properties of an `imap` Object
let lyr = imap.createVectorLayer(profile, layerName);
Global example:
// All functions in the map module are accessible as properties of `oli.map`
var lyr = oli.map.createVectorLayer(profile, layerName);
Methods
(inner) createGroup(profile, guid) → {ol/layer/Group~LayerGroup}
Creates an ol/layer/Group~LayerGroup
instance for the iShare layer group found in profile
with the specified GUID
import { createGroup } from 'ol-ishare/map';
Parameters:
Name | Type | Description |
---|---|---|
profile |
module:ol-ishare/profile~Profile | iShare profile |
guid |
String | GUID of the layer group to create |
Returns:
Group instance
(inner) createImageLayer(profile, layerName) → {ol/layer/Image~Image}
Create a WMS image layer
import { createImageLayer } from 'ol-ishare/map';
Parameters:
Name | Type | Description |
---|---|---|
profile |
module:ol-ishare/profile~Profile | iShare profile |
layerName |
String | The name of the layer to create |
Returns:
Newly created WMS layer
- Type
- ol/layer/Image~Image
(inner) createVectorLayer(profile, layerName) → {ol/layer/Vector~Vector}
Create a WFS vector layer
import { createVectorLayer } from 'ol-ishare/map';
Parameters:
Name | Type | Description |
---|---|---|
profile |
module:ol-ishare/profile~Profile | iShare profile |
layerName |
String | The name of the layer to create |
Returns:
Newly created WFS layer
- Type
- ol/layer/Vector~Vector
(inner) createBaseLayer(profile, layerName) → {ol/layer/Tile}
Create a tiled WMS base layer
import { createBaseLayer } from 'ol-ishare/map';
Parameters:
Name | Type | Description |
---|---|---|
profile |
module:ol-ishare/profile~Profile | iShare profile |
layerName |
String | The name of the base layer to create |
Returns:
Base map layer
- Type
- ol/layer/Tile
(inner) createBaseGroup(profile) → {ol/layer/Group~LayerGroup}
Creates a group of tiled WMS base layers
import { createBaseGroup } from 'ol-ishare/map';
Parameters:
Name | Type | Description |
---|---|---|
profile |
module:ol-ishare/profile~Profile | iShare profile |
Returns:
Base map layer group
(inner) createGroupsAndOverlays(profile, onlyVisibleopt, useProfileLayerOrderopt) → {Array.<ol/layer/Group~LayerGroup>}
Create an Array of ol/layer/Group~LayerGroup
for a profile each containing one or more layers
import { createGroupsAndOverlays } from 'ol-ishare/map';
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
profile |
module:ol-ishare/profile~Profile | iShare profile returned by |
||
onlyVisible |
Boolean |
<optional> |
true
|
If true only create |
useProfileLayerOrder |
Boolean |
<optional> |
false
|
If true add layers in reverse order
|
Returns:
A list of groups which contain the newly created layers
- Type
- Array.<ol/layer/Group~LayerGroup>
(inner) createView(profile, mapSize, useInitialopt) → {ol/View~View}
Creates an ol/View~View
instance for a given profile and mapSize.
Configures the projection, resolutions, initial centre and zoom.
The profile.view properties such as easting, northing and zoom can
be overridden to affect the initial view. If a profile.view.resolution
is defined it will take precidence over the zoom property.
import { createView } from 'ol-ishare/map';
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
profile |
module:ol-ishare/profile~Profile | iShare profile |
||
mapSize |
ol/size~Size | Width and height of the map as returned by |
||
useInitial |
Boolean |
<optional> |
false
|
If |
Returns:
OpenLayers View instance
- Type
- ol/View~View
(inner) createMap(target, ol_opts) → {ol/Map~Map}
Create an OpenLayers Map instance
import { createMap } from 'ol-ishare/map';
Parameters:
Name | Type | Description |
---|---|---|
target |
String | DOM element that the map will be created within |
ol_opts |
ol/PluggableMap~MapOptions | OpenLayers Map Options |
Returns:
map Map instance
- Type
- ol/Map~Map