Skip to content

Instantly share code, notes, and snippets.

View jebu75's full-sized avatar

Jade Freeman jebu75

  • Michigan State Universtiy
  • East Lansing, MI
View GitHub Profile
/*
file: viewer/Controller.js
This file is not merged from upstream source, developer should make all customizations here, not in viewer/core/_Controller.js! Stay out of the Controlller!
*/define([
'dojo/_base/declare',
'viewer/core/_CoreController.js',
'myMixins/Mixin1',
'myMixins/Mixin2'
], function (declare, _CoreController, Mixin1, Mixin2) {
@jebu75
jebu75 / Basemaps.html
Last active August 29, 2015 14:19
Basemap Widget
<div class="${baseClass}">
<!-- this doesn't work -->
<!--<div data-dojo-type="dijit/form/DropDownButton"
data-dojo-attach-point="galleryDropDownButton"
data-dojo-props="iconClass:'fa fa-th-large fa-fw'">
<span>${title}</span>
<div data-dojo-type="dijit/TooltipDialog" >
<div data-dojo-attach-point="basemapGalleryNode"
style="width: 380px; height: 280px; overflow: auto;"></div>
@jebu75
jebu75 / Find.js
Created February 6, 2015 18:26
Find using single graphics layer
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dijit/_WidgetsInTemplateMixin',
'dojo/dom-construct',
'dojo/_base/lang',
'dojo/_base/array',
'dojo/on',
'dojo/keys',
layerControlLayerInfos: {
swipe: true,
swipeScope: true,
noTransparency: false,
sublayers: false,
noZoom: true,
exclude: true
}
@jebu75
jebu75 / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jebu75
jebu75 / TopicRegistry.js
Created September 28, 2014 01:30
Constants in Dojo
define([
"dojo/_base/declare",
], function(
declare
) {
var TopicRegistrySingleton = declare( [], {});
TopicRegistrySingleton.MAP_DISABLE_INFOTEMPLATES = 'map/disableInfoTemplates';
TopicRegistrySingleton.MAP_ENABLE_INFOTEMPLATES = 'map/enableInfoTemplates';
TopicRegistrySingleton.MAP_INITIALIZED = 'map/initialized';
@jebu75
jebu75 / gist:4cc678ebc2ff9e5bcd4c
Created September 15, 2014 11:42
Plant InfoTemplate
_createFeatureLayerInfoTemplate: function () {
var infoTemplate = new InfoTemplate();
infoTemplate.setTitle( 'BG-Base Plant' );
infoTemplate.setContent(
'<h5>${PLANT_NAME}</h5><ul class="list-unstyled">' +
'<li><label>Accession No:&nbsp;</label>${ACC_NUM_AN}</li>' +
'<li><label>Comm. Name:&nbsp;</label>${COMMON_NAME}</li>' +
'<li><label>SubType:&nbsp;</label>${PLANT_SUBTYPE}</li>' +
'<li><label>Status:&nbsp;</label>${PLANT_STATUS}</li>' +
@jebu75
jebu75 / infoWindowListeners
Created September 3, 2014 20:38
infoWindow Listener
//in postCreate method
this.map.infoWindow.on ( 'show', lang.hitch ( this, this.executeRelatedFeaturesTask ) );
this.map.infoWindow.on ( 'hide', lang.hitch ( this, this.popUpClosedHandler ) );
//getting the selected feature (I think there is a change event for the selected feature)
this.set ( 'selectedFeature', this.map.infoWindow.getSelectedFeature ().attributes );