-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3833 from devgateway/task/AMP-30234/wms-layes-hf3401
Task/amp-30234/wms layes hf3401
- Loading branch information
Showing
18 changed files
with
141 additions
and
62 deletions.
There are no files selected for viewing
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
44 changes: 32 additions & 12 deletions
44
amp/TEMPLATE/ampTemplate/gisModule/dev/app/js/amp/data/models/indicator-wms-model.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,40 @@ | ||
var Deferred = require('jquery').Deferred; | ||
var when = require('jquery').when; | ||
var $ = require('jquery'); | ||
var _ = require('underscore'); | ||
var Backbone = require('backbone'); | ||
var LoadOnceMixin = require('../../mixins/load-once-mixin'); | ||
var L = require('../../../../../node_modules/esri-leaflet/dist/esri-leaflet.js'); | ||
|
||
|
||
|
||
module.exports = Backbone.Model | ||
.extend(LoadOnceMixin).extend({ | ||
.extend(LoadOnceMixin).extend({ | ||
|
||
initialize: function() { | ||
// TODO: factor this behavior into an indicator base class | ||
this.listenTo(this, 'change:selected', function(blah, show) { | ||
this.trigger(show ? 'show' : 'hide', this); | ||
initialize: function () { | ||
// TODO: factor this behavior into an indicator base class | ||
this.listenTo(this, 'change:selected', function (blah, show) { | ||
this.trigger(show ? 'show' : 'hide', this); | ||
}); | ||
}, | ||
fetch: function () { | ||
if (!_(this).has('_wmsLoaded')) { | ||
this._wmsLoaded = new Deferred();; | ||
this.wmsLayer = new L.tileLayer.wms(this.get('link'), { | ||
layers: this.get('layer'), | ||
format: 'image/png', | ||
transparent: true, | ||
opacity: 0.75, | ||
updateWhenIdle:true | ||
}); | ||
this._wmsLoaded.resolveWith(this, [this, this.wmsLayer]); | ||
} | ||
return this._wmsLoaded.promise(); | ||
}, | ||
loadAll: function (options) { | ||
debugger; | ||
return when(this.load(options)).promise().done(function () { | ||
$('#map-loading').hide(); | ||
}); | ||
}, | ||
}); | ||
}, | ||
|
||
fetch: function() { | ||
return (new Deferred()).resolve().promise(); // nothing to actually do here... | ||
} | ||
|
||
}); |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.