new BaseSource(layer, sourceOptions, styleOptions)
Creates an instance of BaseSource.
| Name | Type | Description |
|---|---|---|
layer |
Go3dLayer |
The layer that this source belongs to. |
sourceOptions |
Go3dSourcesConfig |
Configuration options for the source. |
styleOptions |
Go3dStylesConfig |
Configuration options for styling. |
Methods
-
__getStyleInstance(styleOptions){BaseStyles}
GoMap/Sources/BaseSource.ts, line 99 -
Creates a style instance based on the provided style options.
Name Type Description styleOptionsGo3dStylesConfig Style configuration options.
Returns:
Type Description BaseStyles The created style instance. -
addData(data)
GoMap/Sources/BaseSource.ts, line 151 -
This only should pass once in the live cicle of the feature if not the styles will be duplicated and the performance will be affected we have to check if the feature already exist in the map
Name Type Description dataGeoJSON The GeoJSON data to add.
-
emit(eventName, data)
GoMap/Sources/BaseSource.ts, line 225 -
Emits a specified event with data to all registered handlers.
Name Type Description eventNameGoMapEvent The event to emit.
dataany The data to pass to event handlers.
-
getEventHandlers(eventName){void}
GoMap/Sources/BaseSource.ts, line 215 -
Retrieves the handlers registered for a specified event.
Name Type Description eventNameGoMapEvent The event to retrieve handlers for.
Returns:
Type Description void Array of handlers for the event. -
getGeojsonFeatures(){Array.<GeoJSONFeature>}
GoMap/Sources/BaseSource.ts, line 167 -
Returns the GeoJSON features currently stored in this source.
Returns:
Type Description Array.<GeoJSONFeature> Array of GeoJSON features. -
getLayer(){Go3dLayer}
GoMap/Sources/BaseSource.ts, line 69 -
Returns the layer associated with this source.
Returns:
Type Description Go3dLayer The layer for this source. -
getMapTalksLayer(){maptalks.VectorLayer}
GoMap/Sources/BaseSource.ts, line 131 -
Returns the maptalks vector layer associated with this source.
Returns:
Type Description maptalks.VectorLayer The maptalks vector layer. -
getStyle(){BaseStyles}
GoMap/Sources/BaseSource.ts, line 142 -
Returns the current style instance for this source.
Returns:
Type Description BaseStyles The current style instance. -
getStyleOptions(){Go3dStylesConfig}
GoMap/Sources/BaseSource.ts, line 50 -
Returns the current style options for this source.
Returns:
Type Description Go3dStylesConfig The current style options. -
hasEvent(eventName){boolean}
GoMap/Sources/BaseSource.ts, line 206 -
Checks if there are handlers registered for a specified event.
Name Type Description eventNameGoMapEvent The event to check for handlers.
Returns:
Type Description boolean True if handlers are registered, otherwise false. -
off(eventName, callback)
GoMap/Sources/BaseSource.ts, line 197 -
Unregisters an event handler for a specified event.
Name Type Description eventNameGoMapEvent optional The event to stop listening for (optional).
callbackvoid optional The callback function to remove (optional).
-
on(event, callback)
GoMap/Sources/BaseSource.ts, line 177 -
Registers an event handler for a specified event.
Name Type Description eventGoMapEvent The event to listen for.
callbackvoid The callback function to handle the event.
-
once(eventName, callback)
GoMap/Sources/BaseSource.ts, line 187 -
Registers a one-time event handler for a specified event.
Name Type Description eventNameGoMapEvent The event to listen for.
callbackvoid The callback function to handle the event.
-
setStyle(styleOptions){BaseStyles}
GoMap/Sources/BaseSource.ts, line 78 -
Sets a new style for the source and applies it to all existing features.
Name Type Description styleOptionsGo3dStylesConfig New style configuration options.
Returns:
Type Description BaseStyles The new style instance.
