Skip to content

Commit 0170134

Browse files
author
Peter Rushforth
committed
Hopefully disable CI by temporarily removing ci-testing.yml
Add templates parameter to TemplatedFeaturesOrTilesLayerGroup (TFOTLG) Add provisional / draft implementation of moveend handler for TFOTLG, based on simplified version of that from TemplatedFeaturesLayer source Exclude handling of <map-feature> for the moment to get things working incrementally, maybe. Add a hard-coded isVisible() implementation that returns true for the moment Add some code to onAdd and onRemove Layer method overrides Add provisional _setUpTemplateVars function
1 parent 5740df9 commit 0170134

File tree

5 files changed

+233
-70
lines changed

5 files changed

+233
-70
lines changed

.github/workflows/ci-testing.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/map-link.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -553,15 +553,18 @@ export class HTMLLinkElement extends HTMLElement {
553553
this.attachShadow({ mode: 'open' });
554554
}
555555
// Use the FeaturesTilesLayerGroup to handle both map-feature and map-tile elements
556-
this._templatedLayer = templatedFeaturesOrTilesLayerGroup({
557-
zoomBounds: this.getZoomBounds(),
558-
extentBounds: this.getBounds(),
559-
zIndex: this.zIndex,
560-
pane: this.parentExtent._extentLayer.getContainer(),
561-
linkEl: this,
562-
projection: this.mapEl._map.options.projection,
563-
renderer: this.mapEl._map.options.renderer
564-
}).addTo(this.parentExtent._extentLayer);
556+
this._templatedLayer = templatedFeaturesOrTilesLayerGroup(
557+
this._templateVars,
558+
{
559+
zoomBounds: this.getZoomBounds(),
560+
extentBounds: this.getBounds(),
561+
zIndex: this.zIndex,
562+
pane: this.parentExtent._extentLayer.getContainer(),
563+
linkEl: this,
564+
projection: this.mapEl._map.options.projection,
565+
renderer: this.mapEl._map.options.renderer
566+
}
567+
).addTo(this.parentExtent._extentLayer);
565568
} else if (this.rel === 'query') {
566569
if (!this.shadowRoot) {
567570
this.attachShadow({ mode: 'open' });

src/mapml/layers/MapFeatureLayerGroup.js

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,25 @@ import { geometry } from '../features/geometry.js';
1212

1313
export var MapFeatureLayerGroup = FeatureGroup.extend({
1414
/*
15-
* M.MapML turns any MapML feature data into a Leaflet layer. Based on L.GeoJSON.
15+
* This is the feature equivalent of MapTileLayer. The intended use is to
16+
* represent an adjacent sequence of <map-feature> elements found in a templated
17+
* response, but MAYBE we'll be able to use it to represent such a sequence
18+
* in a static document response, too, tbd.
19+
*
20+
* This layer will be inserted into the LayerGroup hosted by the <map-link>
21+
* immediately after creation, so that its index within the _layers array of
22+
* that LayerGroup will be equal to its z-index within the LayerGroup's container
23+
*
24+
* <map-tile row="10" col="12" src="url1"></map-tile> LayerGroup._layers[0]
25+
* <map-tile row="11" col="12" src="url2"></map-tile> LayerGroup._layers[0]
26+
* <map-feature id="a"> LayerGroup._layers[1] <- each set of adjacent features
27+
* <map-feature id="b"> LayerGroup._layers[1] <- is a single MapFeatureLayerGroup
28+
* <map-tile row="10" col="12" src="url3"></map-tile> LayerGroup._layers[2]
29+
* <map-tile row="11" col="12" src="url4"></map-tile> LayerGroup._layers[2]
30+
* <map-feature id="c"> LayerGroup._layers[3]
31+
* <map-feature id="d"> LayerGroup._layers[3]
32+
* and so on
1633
*
17-
* Used by MapMLLayer to create _mapmlvectors property, used to render features
1834
*/
1935
initialize: function (mapml, options) {
2036
/*
@@ -535,6 +551,6 @@ export var MapFeatureLayerGroup = FeatureGroup.extend({
535551
}
536552
}
537553
});
538-
export var featureLayer = function (mapml, options) {
539-
return new FeatureLayer(mapml, options);
554+
export var mapFeatureLayerGroup = function (mapml, options) {
555+
return new MapFeatureLayerGroup(mapml, options);
540556
};

src/mapml/layers/MapTileLayer.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,23 @@ import { Util } from '../utils/Util.js';
44
/**
55
* Leaflet layer for handling map-tile elements
66
* Extends GridLayer to create tiles based on map-tile elements
7-
*
7+
*
88
* Similar in intent to MapFeatureLayerGroup, which is a receiver for
99
* map-feature elements' leaflet layer object
10+
*
11+
* This layer will be inserted into the LayerGroup hosted by the <map-link>
12+
* immediately after creation, so that its index within the _layers array of
13+
* that LayerGroup will be equal to its z-index within the LayerGroup's container
14+
*
15+
* <map-tile row="10" col="12" src="url1"></map-tile> LayerGroup._layers[0] <- each set of adjacent tiles
16+
* <map-tile row="11" col="12" src="url2"></map-tile> LayerGroup._layers[0] <- is a single MapTileLayer
17+
* <map-feature id="a"> LayerGroup._layers[1]
18+
* <map-feature id="b"> LayerGroup._layers[1]
19+
* <map-tile row="10" col="12" src="url3"></map-tile> LayerGroup._layers[2]
20+
* <map-tile row="11" col="12" src="url4"></map-tile> LayerGroup._layers[2]
21+
* <map-feature id="c"> LayerGroup._layers[3]
22+
* <map-feature id="d"> LayerGroup._layers[3]
23+
* and so on
1024
*/
1125
export var MapTileLayer = GridLayer.extend({
1226
initialize: function (options) {

0 commit comments

Comments
 (0)