Skip to content

Commit 6853970

Browse files
authored
Merge pull request #69 from prushforth/master
Include content of mapml.css in map-styles.html
2 parents 911d1fa + 83312d6 commit 6853970

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

map-styles.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,24 @@
44
<style>
55
/* required styles copied from leaflet.css for use in web-map and related
66
custom elements */
7-
7+
/* this is required by tiles which are actually divs with multiple images in them */
8+
.leaflet-tile img {
9+
position: absolute;
10+
left: 0;
11+
top: 0;
12+
}
13+
14+
/* MapML treats images like map layers, so far as fade animation is concerned */
15+
.leaflet-fade-anim .leaflet-image-layer {
16+
will-change: opacity;
17+
}
18+
19+
.leaflet-image-layer {
20+
visibility: hidden;
21+
}
22+
.leaflet-image-loaded {
23+
visibility: inherit;
24+
}
825
.leaflet-pane,
926
.leaflet-tile,
1027
.leaflet-marker-icon,

web-map.html

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@
191191
},
192192
attached: function() {
193193
this.async( function () {
194-
console.log(this.localName + '#' + this.id + ' was attached');
195194

196195
// the dimension attributes win, if they're there. A map does not
197196
// have an intrinsic size, unlike an image or video, and so must
@@ -220,7 +219,7 @@
220219
}
221220

222221
// create the Leaflet map if this is the first time attached is called
223-
if (typeof this._map === "undefined") {
222+
if (!this._map) {
224223
this._map = L.map(this.$.map, {
225224
center: new L.LatLng(this.lat, this.lon),
226225
projection: this.projection,
@@ -259,17 +258,6 @@
259258
this.poster.style.display = 'none';
260259
}
261260
}
262-
// log map dimensions. If things go wrong with setup, this may be useful
263-
console.log("map center: "+this._map.getCenter());
264-
var west = this._map.getBounds().getWest(),
265-
south = this._map.getBounds().getSouth(),
266-
east = this._map.getBounds().getEast(),
267-
north = this._map.getBounds().getNorth();
268-
269-
if (west === east || south === north) {
270-
console.log('ERROR: BAD EXTENT');
271-
}
272-
console.log("map bounds bbox=" + this._map.getBounds().toBBoxString());
273261
this._setUpEvents();
274262
}
275263

0 commit comments

Comments
 (0)