Skip to content

Commit

Permalink
add examples of feature layer custom menu
Browse files Browse the repository at this point in the history
  • Loading branch information
green3g committed Feb 27, 2017
1 parent 5f1f817 commit 2848aad
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions viewer/js/config/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@ define([
topic.subscribe('layerControl/hello', function (event) {
topic.publish('growler/growl', {
title: 'Hello!',
message: event.layer._titleForLegend + ' ' + event.subLayer.name + ' says hello'
message: event.layer._titleForLegend + ' ' +
(event.subLayer ? event.subLayer.name : '') +
' says hello'
});
});
topic.subscribe('layerControl/goodbye', function (event) {
topic.publish('growler/growl', {
title: 'Goodbye!',
message: event.layer._titleForLegend + ' ' + event.subLayer.name + ' says goodbye'
message: event.layer._titleForLegend + ' ' +
(event.subLayer ? event.subLayer.name : '') +
' says goodbye'
});
});

Expand Down Expand Up @@ -163,6 +167,13 @@ define([
visible: true,
outFields: ['req_type', 'req_date', 'req_time', 'address', 'district'],
mode: 0
},
layerControlLayerInfos: {
menu: [{
topic: 'hello',
label: 'Say Hello Custom',
iconClass: 'fa fa-smile-o'
}]
}
}, {
type: 'dynamic',
Expand Down Expand Up @@ -431,6 +442,11 @@ define([
topic: 'goodbye',
iconClass: 'fa fa-frown-o',
label: 'Say goodbye'
}],
feature: [{
topic: 'hello',
iconClass: 'fa fa-smile-o',
label: 'Say Hello'
}]
}
}
Expand Down

0 comments on commit 2848aad

Please sign in to comment.