Skip to content

Commit 237feee

Browse files
committed
Revert "Copy (selected) files from master to builds branch for 0.7.0 release."
This reverts commit 649d6c5.
1 parent 649d6c5 commit 237feee

File tree

3,644 files changed

+1123
-505759
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,644 files changed

+1123
-505759
lines changed

bower.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "web-map",
3+
"description": "web-map Customized Built-In HTML <map> element Polymer implementation of the HTML-Map-Element specification.",
4+
"main": "web-map.html",
5+
"version": "0.6.0",
6+
"authors": [
7+
"Maps for HTML Community Group"
8+
],
9+
"homepage": "http://maps4html.github.io/Web-Map-Custom-Element/",
10+
"license": "W3C",
11+
"keywords": [
12+
"web-components",
13+
"polymer",
14+
"web",
15+
"maps",
16+
"map",
17+
"web-map"
18+
],
19+
"repository": {
20+
"type": "git",
21+
"url": "git://github.com/Maps4HTML/Web-Map-Custom-Element.git"
22+
},
23+
"ignore": [
24+
"**/.*",
25+
"node_modules",
26+
"bower_components",
27+
"test",
28+
"tests"
29+
],
30+
"dependencies": {
31+
"mapml-leaflet-plugin": "Maps4HTML/MapML-Leaflet-Plugin#^0.6.0",
32+
"polymer": "^1.5.0"
33+
},
34+
"devDependencies": {
35+
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
36+
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0",
37+
"web-component-tester": "^4.0.0",
38+
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
39+
}
40+
}

device-location.html

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
<dom-module id="device-location">
2+
<script>
3+
4+
Polymer({
5+
is: "device-location",
6+
properties: {
7+
lat : {
8+
type: Number,
9+
value: 0,
10+
reflectToAttribute: false
11+
},
12+
lon : {
13+
type: Number,
14+
value: 0,
15+
reflectToAttribute: false
16+
},
17+
centered : {
18+
type: Boolean,
19+
reflectToAttribute: true
20+
}
21+
},
22+
observers: [
23+
'_toggleCentered(centered)'
24+
],
25+
_toggleCentered: function (centered) {
26+
if (centered) {
27+
// TODO create a point feature on the controls pane at the map center
28+
// DONE register a watchPosition function to move the map as the device
29+
// location changes
30+
var self = this,
31+
options = {
32+
enableHighAccuracy: true,
33+
timeout: 5000,
34+
maximumAge: 0
35+
};
36+
function moveTo(position) {
37+
self.lat = position.coords.latitude;
38+
self.lon = position.coords.longitude;
39+
if (self.parentNode.zoomTo && self.parentNode._map) {
40+
// TODO when the zoomTo bug is fixed, remove zoom+1
41+
self.parentNode.zoomTo(self.lat,self.lon,self.parentNode.zoom+1);
42+
}
43+
};
44+
this._watchID = navigator.geolocation.watchPosition(moveTo,null,options);
45+
} else {
46+
this._deleteWatch();
47+
// TODO replace the marker on the control pane at the center of the map
48+
// with an actual point feature , or simply move that point from
49+
// the control pane to the vector pane
50+
51+
// TODO register a navigator.geolocation.watchPosition function to
52+
// update the location of the above point feature
53+
}
54+
},
55+
detached: function() {
56+
this._deleteWatch();
57+
// TODO if there is a point associated to this control, remove/delete it
58+
},
59+
attached: function() {
60+
this._deleteWatch();
61+
this._createWatch();
62+
if (this.parentNode.controls) {
63+
// add the device-location radio button control to the controls pane
64+
this._map = this.parentNode._map;
65+
}
66+
},
67+
ready: function() {
68+
if (this.centered) {
69+
var self = this,
70+
options = {
71+
enableHighAccuracy: true,
72+
timeout: 5000,
73+
maximumAge: 0
74+
};
75+
function moveTo(position) {
76+
self.lat = position.coords.latitude;
77+
self.lon = position.coords.longitude;
78+
if (self.parentNode.zoomTo && self.parentNode._map) {
79+
// TODO when the zoomTo bug is fixed, remove zoom+1
80+
self.parentNode.zoomTo(self.lat,self.lon,self.parentNode.zoom+1);
81+
}
82+
};
83+
this._watchID = navigator.geolocation.watchPosition(moveTo,null,options);
84+
}
85+
},
86+
// attached: function() {
87+
// this._deleteWatch();
88+
// // could have a _watchID from being created without being detached
89+
// // i.e. never having been attached before...
90+
// if (this.centered) {
91+
// // create point on the control layer at the map center...
92+
//
93+
// }
94+
//
95+
// },
96+
_deleteWatch: function() {
97+
if (this._watchID) {
98+
navigator.geolocation.clearWatch(this._watchID);
99+
delete this._watchID;
100+
}
101+
},
102+
_createWatch: function() {
103+
if (this.centered) {
104+
var self = this,
105+
options = {
106+
enableHighAccuracy: true,
107+
timeout: 5000,
108+
maximumAge: 0
109+
};
110+
function moveTo(position) {
111+
self.lat = position.coords.latitude;
112+
self.lon = position.coords.longitude;
113+
if (self.parentNode.zoomTo && self.parentNode._map) {
114+
// TODO when the zoomTo bug is fixed, remove zoom+1
115+
self.parentNode.zoomTo(self.lat,self.lon,self.parentNode.zoom+1);
116+
}
117+
};
118+
this._watchID = navigator.geolocation.watchPosition(moveTo,null,options);
119+
}
120+
}
121+
});
122+
</script>
123+
</dom-module>

0 commit comments

Comments
 (0)