Skip to content

Commit dcb8441

Browse files
authored
Merge pull request #43 from prushforth/builds
Fix issues uncovered in 0.1.1 release due to not using the most recent
2 parents 4a11256 + 1195f20 commit dcb8441

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

map-area.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<script src="../proj4Leaflet/src/proj4leaflet.js"></script>
1010
<script src="../mapml-leaflet-plugin/mapml.min.js"></script>
1111

12-
1312
<dom-module id="map-area">
1413
<style include="map-styles">
1514
:host {
@@ -100,8 +99,8 @@
10099
// based on the <svg:title> graphics child element.
101100
var title = L.SVG.create('title'),
102101
titleText = document.createTextNode(this.alt);
103-
title.appendChild(titleText);
104-
this._feature._path.appendChild(title);
102+
Polymer.dom(title).appendChild(titleText);
103+
Polymer.dom(this._feature._path).appendChild(title);
105104
}
106105
if (this.href) {
107106
// conditionally act on click on an area link. If no link it should be an

map-layer.html

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<script src="../proj4Leaflet/src/proj4leaflet.js"></script>
1010
<script src="../mapml-leaflet-plugin/mapml.min.js"></script>
1111

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

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

197198
// if controls option is enabled, insert the layer into the overlays array
198-
if (this.parentElement.controls && !this.hidden) {
199-
this._layerControl = this.parentElement._layerControl;
199+
if (Polymer.dom(this).parentNode.controls && !this.hidden) {
200+
this._layerControl = Polymer.dom(this).parentNode._layerControl;
200201
this._layerControl.addOverlay(this._layer, this.label);
201202
}
202203
// toggle the this.disabled attribute depending on whether the layer
@@ -210,12 +211,12 @@
210211
this._layer._map.fire('moveend');
211212
},
212213
attached: function() {
213-
if (this.parentElement.nodeName !== 'MAP') {
214+
if (Polymer.dom(this).parentNode.nodeName !== 'MAP') {
214215
console.log('ERROR: '+ this.localName + '#' + this.id + ' must be a child of a map element');
215216
return;
216217
}
217218
// if the map has been attached, set this layer up wrt Leaflet map
218-
if (this.parentElement._map) {
219+
if (Polymer.dom(this).parentNode._map) {
219220
this._attachedToMap();
220221
}
221222
}

0 commit comments

Comments
 (0)