adiwg-mdtranslator 1.4.0.beta11 → 1.4.0.beta12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_bodyScript.js +32 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_headScript.js +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3c8340795820ae5a7bd9d80cfeee5a0dfacd33f
|
4
|
+
data.tar.gz: 9d0f3b6578f3b365921d7cee86caf536c6f3904d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eadde1287ff2a4767ab788e9aad301fb14ddb3953838be5182d08cd073b7cca96f814a17069f4d648fff76e5d9f97ead4b99d2f255c8536a247fd98332a93305
|
7
|
+
data.tar.gz: 27c73bb6fb90ae5d9d5cda1bacd474c7eda810e9b3607933b7dbd123ecfed5b894194eb7dbb3bca0e64150ed7f4a0be4605bba828bf1b2f0f3bd639f35436b8c
|
@@ -253,8 +253,9 @@ module ADIWG
|
|
253
253
|
@html.hr
|
254
254
|
|
255
255
|
#Load leaflet
|
256
|
-
@html.link( :rel => 'stylesheet', :href => 'http://cdn.leafletjs.com/leaflet
|
257
|
-
@html.script('', :src => 'http://cdn.leafletjs.com/leaflet
|
256
|
+
@html.link( :rel => 'stylesheet', :href => 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css')
|
257
|
+
@html.script('', :src => 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js')
|
258
|
+
@html.script('', :src => 'http://maps.stamen.com/js/tile.stamen.js?v1.3.0')
|
258
259
|
|
259
260
|
# add inline javascript
|
260
261
|
# read javascript from file
|
@@ -4,7 +4,7 @@ if ( typeof L === "object") {
|
|
4
4
|
if (!Array.prototype.forEach) {
|
5
5
|
Array.prototype.forEach = function(callback, thisArg) {
|
6
6
|
var T, k;
|
7
|
-
if (this
|
7
|
+
if (this === null || this === undefined) {
|
8
8
|
throw new TypeError(' this is null or not defined');
|
9
9
|
}
|
10
10
|
var O = Object(this);
|
@@ -27,10 +27,21 @@ if ( typeof L === "object") {
|
|
27
27
|
};
|
28
28
|
}
|
29
29
|
|
30
|
+
var coordsToLatLng = function(coords) {
|
31
|
+
var longitude = coords[0];
|
32
|
+
var latitude = coords[1];
|
33
|
+
var latlng = L.latLng(latitude, longitude);
|
34
|
+
|
35
|
+
if (longitude < 0) {
|
36
|
+
return latlng.wrap(360, 0);
|
37
|
+
} else
|
38
|
+
return latlng;
|
39
|
+
};
|
40
|
+
|
30
41
|
var extentNodeList = document.querySelectorAll('section.extent-section');
|
31
42
|
var extents = Array.prototype.slice.call(extentNodeList);
|
32
43
|
|
33
|
-
var mqAttr = '<span>Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png"></span>';
|
44
|
+
/*var mqAttr = '<span>Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png"></span>';
|
34
45
|
var osmAttr = '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>';
|
35
46
|
|
36
47
|
L.TileLayer.OSM = L.TileLayer.extend({
|
@@ -41,7 +52,7 @@ if ( typeof L === "object") {
|
|
41
52
|
attribution: 'Map data ' + osmAttr + ', ' + mqAttr
|
42
53
|
});
|
43
54
|
}
|
44
|
-
})
|
55
|
+
});*/
|
45
56
|
|
46
57
|
var check = function(i, me, bnds) {
|
47
58
|
if (i < 3) {
|
@@ -75,9 +86,21 @@ if ( typeof L === "object") {
|
|
75
86
|
}
|
76
87
|
|
77
88
|
if (json.geometry === null && bbox) {
|
89
|
+
var bcoor;
|
90
|
+
|
91
|
+
if (!(bbox[0] <= 0 && bbox[2] <= 0) || !(bbox[0] > 0 && bbox[2] > 0)) {
|
92
|
+
//bbox crosses the dateline
|
93
|
+
var bbox0 = bbox[0] < 0 ? L.latLng(0, bbox[0]).wrap(360,0).lng : bbox[0];
|
94
|
+
var bbox2 = bbox[2] < 0 ? L.latLng(0, bbox[2]).wrap(360,0).lng : bbox[2];
|
95
|
+
bbox[0] = Math.min(bbox0, bbox2);
|
96
|
+
bbox[2] = Math.max(bbox0, bbox2);
|
97
|
+
}
|
98
|
+
|
99
|
+
bcoor = [[[bbox[2], bbox[3]], [bbox[0], bbox[3]], [bbox[0], bbox[1]], [bbox[2], bbox[1]], [bbox[2], bbox[3]]]];
|
100
|
+
|
78
101
|
json.geometry = {
|
79
102
|
"type": "Polygon",
|
80
|
-
"coordinates":
|
103
|
+
"coordinates": bcoor
|
81
104
|
};
|
82
105
|
json.properties.style = {
|
83
106
|
color: '#f00',
|
@@ -93,6 +116,7 @@ if ( typeof L === "object") {
|
|
93
116
|
style: function(feature) {
|
94
117
|
return feature.properties.style || {};
|
95
118
|
},
|
119
|
+
coordsToLatLng: coordsToLatLng,
|
96
120
|
onEachFeature: function (feature, layer) {
|
97
121
|
layer.bindPopup(feature.properties.popup,{
|
98
122
|
closeButton: true
|
@@ -123,7 +147,9 @@ if ( typeof L === "object") {
|
|
123
147
|
}, map);
|
124
148
|
|
125
149
|
map.fitBounds(bnds);
|
126
|
-
map.addLayer(new L.TileLayer.OSM());
|
150
|
+
//map.addLayer(new L.TileLayer.OSM());
|
151
|
+
var stamen = new L.StamenTileLayer("terrain");
|
152
|
+
map.addLayer(stamen);
|
127
153
|
});
|
128
154
|
})();
|
129
|
-
}
|
155
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
2
|
function closeAllDetails(){
|
3
|
-
var arr = document.getElementsByTagName("details")
|
3
|
+
var arr = document.getElementsByTagName("details");
|
4
4
|
var len = arr.length;
|
5
5
|
|
6
6
|
for(var i=0; i < len; i++){
|
@@ -9,7 +9,7 @@
|
|
9
9
|
}
|
10
10
|
|
11
11
|
function openAllDetails(){
|
12
|
-
var arr = document.getElementsByTagName("details")
|
12
|
+
var arr = document.getElementsByTagName("details");
|
13
13
|
var len = arr.length;
|
14
14
|
|
15
15
|
for(var i=0; i < len; i++){
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adiwg-mdtranslator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0.
|
4
|
+
version: 1.4.0.beta12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stan Smith
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-07-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -563,7 +563,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
563
563
|
version: 1.3.1
|
564
564
|
requirements: []
|
565
565
|
rubyforge_project:
|
566
|
-
rubygems_version: 2.
|
566
|
+
rubygems_version: 2.4.5
|
567
567
|
signing_key:
|
568
568
|
specification_version: 4
|
569
569
|
summary: The mdtranslator (metadata translator) is a tool for translating metadata
|