Skip to content

Instantly share code, notes, and snippets.

View ca0v's full-sized avatar

Corey Alix ca0v

  • Greenville, SC
View GitHub Profile
@ca0v
ca0v / poly_landmarks.d.ts
Created December 5, 2013 18:52
Here's a typescript interface definition generated from poly_landmarks.sld then modified to eliminate the layer name from the definition.
///<reference path="../../ref.d.ts"/>
interface IStyleLayerDescriptorFilter {
type?: string;
property?: string;
value?: string;
filters?: Array<IStyleLayerDescriptorFilter>;
}
// TODO: requires id to be optional for validation to succeed..report as TS defect?
interface IStyledLayerDescriptorRule {
@ca0v
ca0v / grass.sld.d.ts
Created December 5, 2013 17:24
First attempt at creating a typescript interface for the GeoServer "grass" SLD. Notice "Grass" is in the definition!
interface IGrassTestStyledLayerDescriptor {
version: string;
namedLayers: {
Grass: {
userStyles: Array<{
defaultsPerSymbolizer: boolean;
rules: Array<{
symbolizer: {
Polygon: {
fill: boolean;
@ca0v
ca0v / reloadManager.js
Last active December 29, 2015 17:18
Reloads modules and widgets when corresponding AMD module is modified on the server. Uses SignalR Hub for notification. Facilitates development of widgets and singletons without the need to refresh the browser. State is captured during "unload".
define(["dojo/dom-construct", "dijit/registry"], function (domConstruct, registry) {
return function (myHub) {
myHub.client.reload = function (mid) {
var mods = mid.split(",");
// call unload on old modules
require(mods, function () {
var factories = Array.prototype.slice.apply(arguments);
var state = mods.map(function (mid, i) {
@ca0v
ca0v / async.js
Created November 13, 2013 15:14
async plugin specifically for google maps. example: require(["plugins/async!http://maps.google.com/maps/api/js?v=3&sensor=false"], function () {// can use google.maps now});
/**
* Dojo AMD Google Maps Loader Plugin
*/
define([
"dojo/_base/kernel",
"dojo/topic"
], function (kernel, topic) {
var w = kernel.global;
var cb ="_googleApiLoadCallback";