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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 691860324975f9aaa2aa9ba8a6db68cc9131a1f0
4
- data.tar.gz: 0d93a0f30b01bb3119291053f29ecfeb68557e9d
3
+ metadata.gz: a3c8340795820ae5a7bd9d80cfeee5a0dfacd33f
4
+ data.tar.gz: 9d0f3b6578f3b365921d7cee86caf536c6f3904d
5
5
  SHA512:
6
- metadata.gz: 977f19681d1405f235f6502119808942cebcc368d0b7431a9bf429c1945066cce43d815387aaa63eefa5dd3b038fef39e64136d3f45f74e59b0fe931778c4349
7
- data.tar.gz: 718412b6341ad3634ef9926880e3645c0d3b5709a23d45e106941e05d3d39265438feb0ee662f7f62b42c494634b2fffbfdd166845688cf05d43feb1abcab832
6
+ metadata.gz: eadde1287ff2a4767ab788e9aad301fb14ddb3953838be5182d08cd073b7cca96f814a17069f4d648fff76e5d9f97ead4b99d2f255c8536a247fd98332a93305
7
+ data.tar.gz: 27c73bb6fb90ae5d9d5cda1bacd474c7eda810e9b3607933b7dbd123ecfed5b894194eb7dbb3bca0e64150ed7f4a0be4605bba828bf1b2f0f3bd639f35436b8c
@@ -61,6 +61,6 @@
61
61
  module ADIWG
62
62
  module Mdtranslator
63
63
  # current mdtranslator version
64
- VERSION = "1.4.0.beta11"
64
+ VERSION = "1.4.0.beta12"
65
65
  end
66
66
  end
@@ -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-0.7.3/leaflet.css')
257
- @html.script('', :src => 'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js')
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 == null) {
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 = '&copy; <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": [[[bbox[2], bbox[3]], [bbox[0], bbox[3]], [bbox[0], bbox[1]], [bbox[2], bbox[1]], [bbox[2], bbox[3]]]]
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.beta11
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-06-23 00:00:00.000000000 Z
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.6.4
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