Skip to content

Commit

Permalink
Dispatch an event when the base layer changes (#1204)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao1 authored Dec 5, 2023
1 parent 6545f45 commit 298d76e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nunaliit2-js/src/main/js/nunaliit2/n2.mapAndControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,15 @@ var MapAndControls = $n2.Class('MapAndControls',{

// Re-project vector layer features when base layer is changed
this.map.events.register('changebaselayer',null,function(evt){
// var baseLayer = evt.layer;
const newLayer = evt?.layer
if (newLayer) {
const dispatch = _this._getDispatchService()
dispatch.send(DH, {
type: "mapBaseLayerChanged",
canvasName: _this.getCanvasName(),
newLayer
})
}
var lastProjectionObj = evt.oldProjection;
var currentProjectionObj = _this.map.getProjectionObject();

Expand Down

0 comments on commit 298d76e

Please sign in to comment.