Skip to content

Instantly share code, notes, and snippets.

@amercader
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amercader/1ca3c4df72760ec34c38 to your computer and use it in GitHub Desktop.
Save amercader/1ca3c4df72760ec34c38 to your computer and use it in GitHub Desktop.
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