Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Hubbin it up @ Esri

Dave Bouwman dbouwman

😎
Hubbin it up @ Esri
View GitHub Profile
@dbouwman
dbouwman / PointClusterService.cs
Created Mar 24, 2012
Server Side Clustering Class in C#
View PointClusterService.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SafeRoutes.Infrastructure.Storage.Domain;
namespace SafeRoutes.Infrastructure.Services
{
/// <summary>
/// Service that clusters ProjectPoints
@dbouwman
dbouwman / Viewer.js
Last active Dec 13, 2015
Simple Marionette Application with a global event debugger
View Viewer.js
/*global gmm */
if (!this.gmm || typeof this.gmm !== 'object') {
this.gmm = {};
}
(function () {
'use strict';
gmm.Viewer = new Backbone.Marionette.Application();
gmm.Viewer.addRegions({
toolsRegion: '#tool-list-region'
@dbouwman
dbouwman / ModuleAndController.js
Created Feb 20, 2013
Empty Module and Controller
View ModuleAndController.js
/*global gmm */
if (!this.gmm || typeof this.gmm !== 'object') {
this.gmm = {};
}
(function () {
'use strict';
gmm.Viewer.module('NavbarModule', function (Mod, Viewer, Backbone, Marionette, $, _) {
//==================================
//initializer called on Viewer.start(options)
View NavbarModule.js
/*global gmm */
if (!this.gmm || typeof this.gmm !== 'object') {
this.gmm = {};
}
(function () {
'use strict';
gmm.Viewer.module('NavbarModule', function (Mod, Viewer, Backbone, Marionette, $, _) {
//==================================
//initializer called on Viewer.start(options)
@dbouwman
dbouwman / options.js
Created Feb 20, 2013
Options with a tool items array
View options.js
var options = {
toolItems: [
{name: 'Search', eventToRaise: 'View:Search', iconclass: 'entypo-search'},
{name: 'Stats', eventToRaise: 'View:Stats', iconclass: 'entypo-chart-bar'},
{name: 'Layer List', eventToRaise: 'View:LayerList', iconclass: 'entypo-map'},
]
};
@dbouwman
dbouwman / Index.html
Last active Dec 13, 2015
Markup for our demo app
View Index.html
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta charset="utf-8" />
<title>GeoMacMap</title>
<meta name="description" content="Demo app showing how to compose a loosely coupled mapping application using Backbone.Marionette">
<meta name="author" content="Dave Bouwman / DTSAgile.com">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<link href='http://fonts.googleapis.com/css?family=Oxygen:400,700' rel='stylesheet' type='text/css'>
@dbouwman
dbouwman / options.js
Created Feb 24, 2013
Adding the mapConfig section to the options for our app
View options.js
var options = {
menuItems: [
{ name: 'Current Fires', eventToRaise: 'View:CurrenFires' },
{ name: 'Historic Fires', eventToRaise: 'View:HistoricFires' },
{ name: 'Fire Danger Map', eventToRaise: 'View:FireDanger' }
],
toolItems: [
{name: 'Search', eventToRaise: 'View:Search', iconclass: 'entypo-search'},
{name: 'Stats', eventToRaise: 'View:Stats', iconclass: 'entypo-chart-bar'},
{name: 'Layer List', eventToRaise: 'View:LayerList', iconclass: 'entypo-map'},
@dbouwman
dbouwman / LayerListControllerInit.js
Created Feb 24, 2013
LayerList Controller Initialize is where all the orchestration happens because we never change the collections at runtime.
View LayerListControllerInit.js
//==================================
//Controller for the LayerList Module
//==================================
var Controller = Backbone.Marionette.Controller.extend({
initialize: function (options) {
_.bindAll();
console.log('LayerListMobule:Controller:initialize');
this.region = options.region;
@dbouwman
dbouwman / markup.html
Created Feb 24, 2013
Markup and templates for our layer list
View markup.html
<!-- Container for the Layer List -->
<div id="layer-list-region" style="display:none;" class="view"></div>
<!-- Templates -->
<script id="layer-list-template" type="text/template" >
<div class="header">
<h3>Map Layers</h3>
<span id="layer-list-close" class="entypo-cancel-circled"></span>
</div>
<div class="clear"></div>
@dbouwman
dbouwman / layout.js
Created Feb 24, 2013
Snippet showing how the layout is created, and how we setup the regions which are nodes in the layout's template
View layout.js
var LayerListLayoutView = Backbone.Marionette.Layout.extend({
template: "#layer-list-template",
//define the regions using selectors for nodes
//inside the layout's template
regions: {
layerListRegion: "#layer-list",
basemapRegion: "#basemap-list"
},
events:{'click #layer-list-close':'closeView'},
closeView:function(){
You can’t perform that action at this time.