Skip to content

Commit 4cb4ffc

Browse files
committed
WIP on map-tile, TemplatedFeaturesOrTilesLayerGroup, map-link
remove redundant method from TemplatedFeaturesOrTilesLayerGroup
1 parent 6f69c75 commit 4cb4ffc

File tree

6 files changed

+636
-218
lines changed

6 files changed

+636
-218
lines changed

index.html

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,10 @@
3333
</style>
3434
</noscript>
3535
</head>
36-
<body> <!-- commentsrc="http://localhost:8080/geoserver/wms?LAYERS=spearfish&amp;BBOX=-1.1563633841554081E7%2C5522909.350493801%2C-1.1535183234733827E7%2C5543493.457347733&amp;HEIGHT=768&amp;WIDTH=555&amp;SRS=MapML%3AOSMTILE&amp;STYLES=&amp;FORMAT=text%2Fmapml&amp;format_options=mapml-wms-format%3Aimage%2Fpng%3Bmapmlusemultiextents%3Afalse%3Bmapmlusetiles%3Afalse%3Bmapmlusefeatures%3Atrue%3Bmapmlskipattributes%3Atrue%3B&amp;SERVICE=WMS&amp;REQUEST=GetMap&amp;VERSION=1.3.0" -->
36+
<body> <!-- comment -->
3737
<mapml-viewer projection="OSMTILE" zoom="14" lat="44.43522010257481" lon="-103.67815017700197" controls>
38-
<map-layer label="Spearfish" checked >
39-
<map-extent units="OSMTILE" checked="checked" hidden="hidden">
40-
<map-input name="z" type="zoom" min="0" max="18"></map-input>
41-
<map-input name="xmin" type="location" rel="map" position="top-left" axis="easting" units="pcrs" min="-1.1563626767407158E7" max="-1.1535226376969203E7"></map-input>
42-
<map-input name="ymin" type="location" rel="map" position="bottom-left" axis="northing" units="pcrs" min="5522923.367797318" max="5543507.621758875"></map-input>
43-
<map-input name="xmax" type="location" rel="map" position="top-right" axis="easting" units="pcrs" min="-1.1563626767407158E7" max="-1.1535226376969203E7"></map-input>
44-
<map-input name="ymax" type="location" rel="map" position="top-left" axis="northing" units="pcrs" min="5522923.367797318" max="5543507.621758875"/>
45-
<map-input name="w" type="width" min="1" max="4096"></map-input>
46-
<map-input name="h" type="height" min="1" max="4096"></map-input>
47-
<map-link tref="http://localhost:8080/geoserver/wms?format_options=mapmlfeatures:true&amp;request=GetMap&amp;crs=MapML:OSMTILE&amp;bbox={xmin},{ymin},{xmax},{ymax}&amp;format=text/mapml&amp;language=en&amp;version=1.3.0&amp;transparent=false&amp;service=WMS&amp;layers=spearfish&amp;width={w}&amp;styles=&amp;height={h}" rel="features"></map-link>
48-
</map-extent>
38+
<map-layer label="Spearfish" checked src="http://localhost:8080/geoserver/wms?LAYERS=spearfish&BBOX=-1.1563633841554081E7,5522909.350493801,-1.1535183234733827E7,5543493.457347733&HEIGHT=768&WIDTH=555&SRS=MapML:OSMTILE&STYLES=&FORMAT=text%2Fmapml&format_options=mapml-wms-format:image%2Fpng;mapmlusemultiextents:false;mapmlusetiles:false;mapmlusefeatures:true;mapmlskipattributes:true;&SERVICE=WMS&REQUEST=GetMap&VERSION=1.3.0">
39+
4940
</map-layer>
5041
</mapml-viewer>
5142

src/map-tile.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ export class HTMLTileElement extends HTMLElement {
7676
: this.parentNode.host;
7777

7878
this._createOrGetTileLayer();
79-
79+
8080
// Calculate the extent
81-
this._calculateExtent();
81+
//this._calculateExtent();
8282
}
8383

8484
disconnectedCallback() {
@@ -136,9 +136,7 @@ export class HTMLTileElement extends HTMLElement {
136136
return Util.getClosest(this, 'map-layer,layer-');
137137
}
138138
attributeChangedCallback(name, oldValue, newValue) {
139-
/* jshint ignore:start */
140-
if (this.#hasConnected) {
141-
/* jshint ignore:end */
139+
if (this.#hasConnected /* jshint ignore:line */) {
142140
switch (name) {
143141
case 'src':
144142
case 'row':
@@ -161,11 +159,6 @@ export class HTMLTileElement extends HTMLElement {
161159
}
162160
}
163161
}
164-
165-
/**
166-
* Creates or gets a reference to a MapTileLayer for this tile
167-
* @private
168-
*/
169162
_createOrGetTileLayer() {
170163
if (this.isFirstTile()) {
171164
const parentElement = this._parentElement;
@@ -190,14 +183,8 @@ export class HTMLTileElement extends HTMLElement {
190183
if (this._tileLayer) {
191184
this._tileLayer.addMapTile(this);
192185
}
193-
194186
}
195187
}
196-
197-
/**
198-
* Calculates the extent of this tile
199-
* @private
200-
*/
201188
_calculateExtent() {
202189
const mapEl = this.getMapEl();
203190

0 commit comments

Comments
 (0)