Package 📦 | @bespunky/angular-google-maps/overlays |
---|---|
Directive âš™ | <bs-google-maps-data/> |
Wrapper 🧬 | GoogleMapsData |
Name for template reference variables: dataLayer
Wrapper API | Directive API | Live Demo
The data layer is different to the rest of the overlays. It doesn't do much on its own, and is meant to be used in conjunction with geometry features.
You must either place geometry feature directives inside of the data directive or use the wrapper to create the features.
The native data layer object raises events for features it holds, which in turn means you'd have to find out which feature raised the event. <bs-google-maps-data/>
and <bs-google-maps-feature>
play nicely together to bridge this. See Geometry Features.
The wrapper implements feature tracking automatically. Access tracked features using the features
property:
const data = ... // Fetch the data layer wrapper
const yourFeatures = data.features.list; // GoogleMapsFeature[]
Unlike overlay tracker, the features tracker doesn't provide a
changes
observable. That is because the native data layer already provides events for detecting changes. Bind your<bs-google-maps-data>
directive'saddFeature
andremoveFeature
events and you'll get the same result. See demo for more details.
As with feature events, @bespunky/angular-google-maps
aspires bridging the gap between the native data object and the native feature objects it holds. So feature styling and other tasks are about to become a lot easier.
Stay tuned for new versions and breaking changes...
Topic | Description |
---|---|
Geometry Types | Flexibility for geometries. |