Skip to content

Commit

Permalink
Add demos for 2 new widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcgee committed Apr 12, 2018
1 parent 2eb98a2 commit d23e0aa
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ A simple yet configurable disclaimer widget.

---
### Elevation Profile
An updated Elevation Profile widget based on previously contributed widget by [goriliukasbuxton](https://github.com/goriliukasbuxton/ElevationProfile2) and [ERS-Long](https://github.com/ERS-Long/ElevationsProfile).
An updated Elevation Profile widget based on previously contributed widgets by [goriliukasbuxton](https://github.com/goriliukasbuxton/ElevationProfile2) and [ERS-Long](https://github.com/ERS-Long/ElevationsProfile).
##### [Demo](http://tmcgee.github.io/cmv-widgets/demo.html?config=elevationProfile)
##### [Widget](https://github.com/tmcgee/cmv-widgets/tree/master/widgets/ElevationProfile.js)

---
Expand Down Expand Up @@ -97,6 +98,7 @@ A simple widget to toggle the visibility of a set of layers. Only a single layer
---
### Locator Control
A widget to allow the user to change the properties of the CMV Locate Button widget in real-time.
##### [Demo](http://tmcgee.github.io/cmv-widgets/demo.html?config=locatorControl)
##### [Widget](https://github.com/tmcgee/cmv-widgets/tree/master/widgets/LocatorControl.js)

---
Expand Down
77 changes: 77 additions & 0 deletions config/elevationprofile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
define({
isDebug: false,

mapOptions: {
basemap: 'topo',
center: [-120.0417, 39.0917],
zoom: 10,
sliderStyle: 'small'
},

titles: {
header: 'CMV Elevation Profile Example',
subHeader: 'This is an example of using the Elevation Profile widget',
pageTitle: 'CMV Elevation Profile Widget'
},

collapseButtonsPane: 'center', //center or outer

panes: {
bottom: {
id: 'sidebarBottom',
placeAt: 'outer',
splitter: true,
collapsible: true,
region: 'bottom',
open: 'none', // using false doesn't work
style: 'height: 350px',
content: '<div id="attributesContainer"></div>'
}
},

operationalLayers: [],

widgets: {
growler: {
include: true,
id: 'growler',
type: 'domNode',
path: 'gis/dijit/Growler',
srcNodeRef: 'growlerDijit',
options: {}
},
elevationProfile: {
include: true,
type: 'titlePane',
path: 'widgets/ElevationProfile',
canFloat: true,
title: 'Elevation Profile',
iconClass: 'fa fa-fw fa-area-chart',
open: true,
position: 0,
options: {
map: true
}
},

attributesTable: {
include: true,
id: 'attributesContainer',
type: 'domNode',
srcNodeRef: 'attributesContainer',
path: 'widgets/AttributesTable',
options: {
map: true,
mapClickMode: true,

// use a tab container for multiple tables or
// show only a single table
useTabs: true,

// used to open the sidebar after a query has completed
sidebarID: 'sidebarBottom'
}
}

}
});
70 changes: 70 additions & 0 deletions config/locatorControl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
define({
isDebug: false,

mapOptions: {
basemap: 'streets',
center: [-96.59179687497497, 39.09596293629694],
zoom: 5,
sliderStyle: 'small'
},

titles: {
header: 'CMV Locator Control Widget',
subHeader: 'This is an example of using the Locator Control widget',
pageTitle: 'CMV Locator Conntrol Widget'
},

panes: {
left: {
collapsible: false,
style: 'display:none'
}
},
collapseButtonsPane: 'center', //center or outer

operationalLayers: [],

widgets: {
growler: {
include: true,
id: 'growler',
type: 'domNode',
path: 'gis/dijit/Growler',
srcNodeRef: 'growlerDijit',
options: {}
},
locateButton: {
include: true,
id: 'locateButton',
type: 'domNode',
path: 'gis/dijit/LocateButton',
srcNodeRef: 'homeButton',
options: {
map: true,
scale: 1000,
highlightLocation: true,
useTracking: false,
clearOnTrackingStop: true,
geolocationOptions: {
maximumAge: 0,
timeout: 5000,
enableHighAccuracy: true
}
}
},
locatorControl: {
include: true,
id: 'locatorControl',
type: 'floating',
path: 'widgets/LocatorControl',
title: 'Locator Settings',
iconClass: 'fa-compass',
preload: true,
options: {
html: '<i class="fa fa-compass fa-3x" style="cursor:pointer;"></i>',
domTarget: 'locateButton',
openOnStartup: true
}
}
}
});
10 changes: 7 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ <h2 id="disclaimer">Disclaimer</h2>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h2 id="elevation-profile">Elevation Profile</h2>
<p>An updated Elevation Profile widget based on previously contributed widget by [goriliukasbuxton](https://github.com/goriliukasbuxton/ElevationProfile2) and [ERS-Long](https://github.com/ERS-Long/ElevationsProfile).</p>
<br/><br/>
<p>An updated Elevation Profile widget based on previously contributed widgets by<a href="https://github.com/goriliukasbuxton/ElevationProfile2">goriliukasbuxton</a> and <a href="https://github.com/ERS-Long/ElevationsProfile">ERS-Long</a>.</p>
<p>
<a href="demo.html?config=elevationProfile" target="cmv-demo-elevationProfile" class="btn btn-primary btn-lg">Demo</a>
</p>
<br/><br/>
</div>
</div>
Expand Down Expand Up @@ -164,7 +166,9 @@ <h2 id="layer-toggle">Layer Toggle</h2>
<div class="col-md-8 col-md-offset-2">
<h2 id="locator-control">Locator Control</h2>
<p>A widget to allow the user to change the properties of the CMV Locate Button widget in real-time.</p>
<br/><br/>
<p>
<a href="demo.html?config=locatorControl" target="cmv-demo-locatorControl" class="btn btn-primary btn-lg">Demo</a>
</p>
<br/><br/>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion widgets/LocatorControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ define([
i18n: i18n,
baseClass: 'cmwLocatorControlWidget',

html: '<i class="fa fa-compass fa-3x fa-fw" style="cursor:pointer;color:#FF0"></i>',
html: '<i class="fa fa-compass fa-2x fa-fw" style="cursor:pointer;color:#FF0"></i>',
domTarget: 'helpDijit',
draggable: true,

Expand Down

0 comments on commit d23e0aa

Please sign in to comment.