Skip to content

Commit

Permalink
Add new _createMap method to allow custom mixins to override the me…
Browse files Browse the repository at this point in the history
…thod.

This is useful when using CMV with BootstrapMap
(https://github.com/Esri/bootstrap-map-js).
  • Loading branch information
tmcgee committed Dec 16, 2015
1 parent c3a8737 commit c621af9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions viewer/js/viewer/_MapMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ define([
var returnDeferred = new Deferred();
var returnWarnings = [];

var container = dom.byId(this.config.layout.map) || 'mapCenter';
this.map = new Map(container, this.config.mapOptions);
this._createMap();

if (this.config.mapOptions.basemap) {
this.map.on('load', lang.hitch(this, '_initLayers', returnWarnings));
Expand All @@ -44,6 +43,11 @@ define([
return returnDeferred;
},

_createMap: function () {
var container = dom.byId(this.config.layout.map) || 'mapCenter';
this.map = new Map(container, this.config.mapOptions);
},

_onLayersAddResult: function (returnDeferred, returnWarnings, lyrsResult) {
array.forEach(lyrsResult.layers, function (addedLayer) {
if (addedLayer.success !== true) {
Expand Down

0 comments on commit c621af9

Please sign in to comment.