Skip to content

Commit

Permalink
Merge pull request #43 from prushforth/builds
Browse files Browse the repository at this point in the history
Fix issues uncovered in 0.1.1 release due to not using the most recent
  • Loading branch information
prushforth authored Jun 27, 2016
2 parents 4a11256 + 1195f20 commit dcb8441
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
5 changes: 2 additions & 3 deletions map-area.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<script src="../proj4Leaflet/src/proj4leaflet.js"></script>
<script src="../mapml-leaflet-plugin/mapml.min.js"></script>


<dom-module id="map-area">
<style include="map-styles">
:host {
Expand Down Expand Up @@ -100,8 +99,8 @@
// based on the <svg:title> graphics child element.
var title = L.SVG.create('title'),
titleText = document.createTextNode(this.alt);
title.appendChild(titleText);
this._feature._path.appendChild(title);
Polymer.dom(title).appendChild(titleText);
Polymer.dom(this._feature._path).appendChild(title);
}
if (this.href) {
// conditionally act on click on an area link. If no link it should be an
Expand Down
19 changes: 10 additions & 9 deletions map-layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<script src="../proj4Leaflet/src/proj4leaflet.js"></script>
<script src="../mapml-leaflet-plugin/mapml.min.js"></script>


<dom-module id="layer-">
<!-- in polymer 1.0.x, styles must be outside of the <template> element
https://www.polymer-project.org/1.0/docs/migration.html#local-dom-template -->
Expand Down Expand Up @@ -169,20 +168,22 @@
// zoom range, extent and projection are. meta elements in content to
// allow the author to provide this explicitly are one way, they will
// be parsed from the second parameter here
this._layer = M.mapMLLayer(this.src ? new URI(this.src).resolve(new URI(this.baseURI)).toString(): null, this);
// IE 11 did not have a value for this.baseURI for some reason
var base = this.baseURI ? this.baseURI : document.baseURI;
this._layer = M.mapMLLayer(this.src ? new URI(this.src).resolve(new URI(base)).toString(): null, this);
this._layer.on('extentload', this._onLayerExtentLoad, this);
},
_attachedToMap: function() {
// set i to the index of this layer element in the set of layers
var i = 0;
for (var nodes = this.parentNode.children;i < nodes.length;i++) {
if (this.parentNode.children[i] === this) {
for (var nodes = Polymer.dom(this).parentNode.children;i < nodes.length;i++) {
if (Polymer.dom(this).parentNode.children[i] === this) {
break;
}
}
L.setOptions(this._layer, {zIndex: i+1, opacity: window.getComputedStyle(this).opacity});
// make sure the Leaflet layer has a reference to the map
this._layer._map = this.parentElement._map;
this._layer._map = Polymer.dom(this).parentNode._map;
// notify the layer that it is attached to a map (layer._map)
this._layer.fire('attached');

Expand All @@ -195,8 +196,8 @@
this._layer.on('add remove', this._onLayerChange, this);

// if controls option is enabled, insert the layer into the overlays array
if (this.parentElement.controls && !this.hidden) {
this._layerControl = this.parentElement._layerControl;
if (Polymer.dom(this).parentNode.controls && !this.hidden) {
this._layerControl = Polymer.dom(this).parentNode._layerControl;
this._layerControl.addOverlay(this._layer, this.label);
}
// toggle the this.disabled attribute depending on whether the layer
Expand All @@ -210,12 +211,12 @@
this._layer._map.fire('moveend');
},
attached: function() {
if (this.parentElement.nodeName !== 'MAP') {
if (Polymer.dom(this).parentNode.nodeName !== 'MAP') {
console.log('ERROR: '+ this.localName + '#' + this.id + ' must be a child of a map element');
return;
}
// if the map has been attached, set this layer up wrt Leaflet map
if (this.parentElement._map) {
if (Polymer.dom(this).parentNode._map) {
this._attachedToMap();
}
}
Expand Down

0 comments on commit dcb8441

Please sign in to comment.