Skip to content

Commit

Permalink
Merge pull request #499 from cmv/feature/add-new-createMap_method
Browse files Browse the repository at this point in the history
Add new `_createMap` method to allow custom mixins to override
  • Loading branch information
DavidSpriggs committed Jan 14, 2016
2 parents 4cf83ff + 0654d33 commit a385dfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@
"comma-style": 2,
"computed-property-spacing": [2, "never"],
"consistent-this": [2, "self"],
"constructor-super": 2,
"func-style": [2, "declaration"],
"id-match": [2, "^[a-z]+([A-Z][a-z]+)*$", {"properties": true}],
"indent": [2, 4],
"key-spacing": [2, {
"beforeColon": false,
Expand Down
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 a385dfa

Please sign in to comment.