Skip to content

Commit

Permalink
Merge pull request #69 from prushforth/master
Browse files Browse the repository at this point in the history
Include content of mapml.css in map-styles.html
  • Loading branch information
prushforth authored Jul 27, 2017
2 parents 911d1fa + 83312d6 commit 6853970
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
19 changes: 18 additions & 1 deletion map-styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,24 @@
<style>
/* required styles copied from leaflet.css for use in web-map and related
custom elements */

/* this is required by tiles which are actually divs with multiple images in them */
.leaflet-tile img {
position: absolute;
left: 0;
top: 0;
}

/* MapML treats images like map layers, so far as fade animation is concerned */
.leaflet-fade-anim .leaflet-image-layer {
will-change: opacity;
}

.leaflet-image-layer {
visibility: hidden;
}
.leaflet-image-loaded {
visibility: inherit;
}
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
Expand Down
14 changes: 1 addition & 13 deletions web-map.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
},
attached: function() {
this.async( function () {
console.log(this.localName + '#' + this.id + ' was attached');

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

// create the Leaflet map if this is the first time attached is called
if (typeof this._map === "undefined") {
if (!this._map) {
this._map = L.map(this.$.map, {
center: new L.LatLng(this.lat, this.lon),
projection: this.projection,
Expand Down Expand Up @@ -259,17 +258,6 @@
this.poster.style.display = 'none';
}
}
// log map dimensions. If things go wrong with setup, this may be useful
console.log("map center: "+this._map.getCenter());
var west = this._map.getBounds().getWest(),
south = this._map.getBounds().getSouth(),
east = this._map.getBounds().getEast(),
north = this._map.getBounds().getNorth();

if (west === east || south === north) {
console.log('ERROR: BAD EXTENT');
}
console.log("map bounds bbox=" + this._map.getBounds().toBBoxString());
this._setUpEvents();
}

Expand Down

0 comments on commit 6853970

Please sign in to comment.