new GridReference( [Control])
Draw a grid reference on the map and add an index.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
Control |
Object |
<optional> |
options.
|
Fires:
- event:select
Extends
Methods
-
getFeatureName(f)
-
Returns the text to be displayed in the index
Parameters:
Name Type Description f
ol.Feature the feature
Returns:
the text to be displayed in the index
- Type
- string
-
getReference(coords)
-
Get reference for a coord
Parameters:
Name Type Description coords
ol.coordinate Returns:
the reference
- Type
- string
-
getStyle()
-
Get style
Returns:
style
- Type
- ol.style.Style
-
indexTitle(f)
-
Get the feature title
Parameters:
Name Type Description f
ol.Feature Returns:
the first letter of the eature name (getFeatureName)
-
setIndex(features)
-
Display features in the index
Parameters:
Name Type Description features
Array.<ol.Feature> | ol.Collection.<ol.Feature> -
setMap(map)
-
Remove the control from its current map and attach it to the new map.
Parameters:
Name Type Description map
ol.Map Map.
-
setStyle(style)
-
Set style
Parameters:
Name Type Description style
ol.style.Style -
sortFeatures(a, b)
-
Sort function
Parameters:
Name Type Description a
ol.Feature first feature
b
ol.Feature second feature
Returns:
0 if a==b, -1 if a<b, 1 if a>b
- Type
- Number