Last active
August 29, 2015 14:21
-
-
Save amercader/1ca3c4df72760ec34c38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/ckanext/geoview/public/js/wmts_preview.js b/ckanext/geoview/public/js/wmts_preview.js | |
index bce4169..5d2d7ab 100644 | |
--- a/ckanext/geoview/public/js/wmts_preview.js | |
+++ b/ckanext/geoview/public/js/wmts_preview.js | |
@@ -14,37 +14,15 @@ ckan.module('wmtspreview', function (jQuery, _) { | |
} | |
}); | |
- // use CORS, if supported by browser and server | |
- if (jQuery.support.cors && preload_resource['original_url'] !== undefined) { | |
- jQuery.get(preload_resource['original_url']) | |
- .done( | |
- function(data){ | |
- self.showPreview(preload_resource['original_url'], data); | |
- }) | |
- .fail( | |
- function(jqxhr, textStatus, error) { | |
- jQuery.get(preload_resource['url']).done( | |
- function(data){ | |
- self.showPreview(preload_resource['original_url'], data); | |
- }) | |
- .fail( | |
- function(jqXHR, textStatus, errorThrown) { | |
- self.showError(jqXHR, textStatus, errorThrown); | |
- } | |
- ); | |
- } | |
- ); | |
- } else { | |
- jQuery.get(preload_resource['url']).done( | |
- function(data){ | |
- self.showPreview(preload_resource['original_url'], data); | |
- }) | |
- .fail( | |
- function(jqXHR, textStatus, errorThrown) { | |
- self.showError(jqXHR, textStatus, errorThrown); | |
- } | |
- ); | |
- } | |
+ jQuery.get(preload_resource['url']).done( | |
+ function(data){ | |
+ self.showPreview(preload_resource['original_url'], data); | |
+ }) | |
+ .fail( | |
+ function(jqXHR, textStatus, errorThrown) { | |
+ self.showError(jqXHR, textStatus, errorThrown); | |
+ } | |
+ ); | |
}, | |
showError: function (jqXHR, textStatus, errorThrown) { | |
@@ -75,7 +53,6 @@ ckan.module('wmtspreview', function (jQuery, _) { | |
function layerChange(e) { | |
var url = e.layer._url; | |
overlay = e.layer; | |
- self.map.fitBounds(mapLatLngBounds[url.substring(url.lastIndexOf('LAYER='), url.indexOf('&STYLE')).split('=')[1]]); | |
} | |
function loadEPSG(url, callback) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment