Data-driven styling
FeatureLayer interface
google.maps.FeatureLayer
interface
An interface representing a map layer containing features of a specific FeatureType whose style can be overridden client-side, or have events attached.
Properties | |
|---|---|
featureType |
Type: The |
isAvailable |
Type: Whether this |
|
Type: The Dataset ID for this |
style optional |
Type: The style of |
Methods | |
|---|---|
addListener |
Parameters:
Return Value: Adds the given listener function to the given event name. Returns an identifier for this listener that can be used with |
Events | |
|---|---|
click |
Arguments:
This event is fired when the |
mousemove |
Arguments:
This event is fired when the user's mouse moves over the |
FeatureType constants
google.maps.FeatureType
constants
Identifiers for feature types.
Access by calling const {FeatureType} = await google.maps.importLibrary("maps").
See Libraries in the Maps JavaScript API.
Constants | |
|---|---|
ADMINISTRATIVE_AREA_LEVEL_1 |
Indicates a first-order civil entity below the country level. |
ADMINISTRATIVE_AREA_LEVEL_2 |
Indicates a second-order civil entity below the country level. |
COUNTRY |
Indicates the national political entity. |
|
Indicates a third-party dataset. |
LOCALITY |
Indicates an incorporated city or town political entity. |
POSTAL_CODE |
Indicates a postal code as used to address postal mail within the country. Includes zip codes. |
SCHOOL_DISTRICT |
Indicates a school district. |
FeatureStyleFunctionOptions interface
google.maps.FeatureStyleFunctionOptions
interface
Options passed to a FeatureStyleFunction.
Properties | |
|---|---|
feature |
Type:
|
FeatureStyleOptions interface
google.maps.FeatureStyleOptions
interface
These options specify the way the style of a Feature should be modified on a map.
Properties | |
|---|---|
fillColor optional |
Type: Hex RGB string (like "#00FF00" for green). Only applies to polygon geometries. |
fillOpacity optional |
Type: The fill opacity between 0.0 and 1.0. Only applies to polygon geometries. |
strokeColor optional |
Type: Hex RGB string (like "#00FF00" for green). |
strokeOpacity optional |
Type: The stroke opacity between 0.0 and 1.0. Only applies to line and polygon geometries. |
strokeWeight optional |
Type: The stroke width in pixels. Only applies to line and polygon geometries. |
Feature interface
google.maps.Feature
interface
An interface representing a vector map tile feature. These are inputs to the FeatureStyleFunction. Do not save a reference to a particular Feature object because the reference will not be stable.
Properties | |
|---|---|
featureType |
Type:
|
DatasetFeature interface
google.maps.DatasetFeature
interface
An interface representing a feature from a Dataset. The featureType of a DatasetFeature will always be FeatureType.DATASET.
This interface extends
Feature.
Properties | |
|---|---|
datasetAttributes |
Type: Key-value mapping of the feature's attributes. |
datasetId |
Type: Dataset id of the dataset that this feature belongs to. |
Inherited:
featureType
| |
FeatureMouseEvent interface
google.maps.FeatureMouseEvent
interface
This object is returned from a mouse event on a FeatureLayer.
This interface extends
MapMouseEvent.
Properties | |
|---|---|
features |
The |
Inherited:
domEvent,
latLng
| |
Methods | |
|---|---|
Inherited:
stop
|