Skip to content

Instantly share code, notes, and snippets.

@paul121
Last active May 18, 2021 22:34
Show Gist options
  • Save paul121/e3f701976bea216146e59289c4927a8e to your computer and use it in GitHub Desktop.
Save paul121/e3f701976bea216146e59289c4927a8e to your computer and use it in GitHub Desktop.
OL-federated Drupal library example
# Library definitions prefixed with Drupal module name
# Some kind of a ol-federated provided entrypoint? All OL chunks depend on this?
farm_map/ol_federated_entrypoint: { .. }
# Many ol_* chunks each provided as a library.
farm_map/ol_core: { .. } # Ideally we can create a single chunk with all of the essential OL chunks needed for farmOS-map.
farm_map/ol_control_*: { .. } # Optional controls
farm_map/ol_interaction_*: { .. } # Optional interactions
farm_map/ol_source_*: { .. } # Optional sources eg: Tile, Vector, WMS, XYZ... some included in ol_core?
farm_map/ol_format_*: { .. } # Optional formats eg: GeoJSON, WKT, etc.. some included in ol_core?
farm_map/ol_style_*: { .. } # Optional styles, some included in ol_core?
# farmOS-map JS library
farm_map/farmOS-map:
dependencies:
- farm_map/ol_core
# Helper JS to create map instances (already exists)
farm_map/farm_map
dependencies:
- farm_map/farmOS-map
- core/drupalSettings
# Core WKT behavior
farm_map/behavior_wkt:
dependencies:
- farm_map/ol_format_wkt
- farm_map/farm_map
# Contrib behavior that needs more OL features.
contrib_module/behavior_fancy:
dependencies:
- farm_map/ol_format_geojson
- farm_map/ol_style_fill
- farm_map/ol_style_image
- farm_map/ol_interaction_drag
- farm_map/farm_map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment