Skip to content

Commit

Permalink
Merge pull request #324 from cmv/patch/LayerControl-1.3.2
Browse files Browse the repository at this point in the history
Add kml legend
  • Loading branch information
btfou committed Dec 3, 2014
2 parents cfa562b + f645325 commit ec89707
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions viewer/js/gis/dijit/LayerControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ define([
},
// zoom to layer
_zoomToLayer: function (layer) {
if (layer.declaredClass === 'esri.layers.KMLLayer') {
return;
}

// need to "merge" each kml layers fullExtent for project geometries

var map = this.map;
if (layer.spatialReference === map.spatialReference) {
map.setExtent(layer.fullExtent, true);
Expand Down
8 changes: 6 additions & 2 deletions viewer/js/gis/dijit/LayerControl/controls/KML.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ define([
_WidgetBase,
_TemplatedMixin,
_Contained,
_Control
_Control,
legendUtil
) {
var KMLControl = declare([_WidgetBase, _TemplatedMixin, _Contained, _Control], {
_layerType: 'vector', // constant
_esriLayerType: 'kml', // constant
// create and legend
_layerTypeInit: function () {
this._expandRemove();
this._expandClick();
if (legendUtil.isLegend(this.controlOptions.noLegend, this.controller.noLegend)) {
legendUtil.layerLegend(this.layer, this.expandNode);
}
}
});
return KMLControl;
Expand Down

0 comments on commit ec89707

Please sign in to comment.