Skip to content

Instantly share code, notes, and snippets.

View odoe's full-sized avatar
👽
It's full of stars

Rene Rubalcava odoe

👽
It's full of stars
View GitHub Profile
@odoe
odoe / MapComp.as
Created January 27, 2011 20:07
Sample component of using NativeMappedSignal with ESRI DrawTool and Graphics
package net.odoe.nmsExample.components
{
import com.esri.ags.Graphic;
import com.esri.ags.Map;
import com.esri.ags.events.DrawEvent;
import com.esri.ags.layers.GraphicsLayer;
import com.esri.ags.tools.DrawTool;
import flash.events.Event;
import flash.events.MouseEvent;
@odoe
odoe / PrintWidget.mxml
Created May 12, 2011 20:18
ESRI Flexviewer Print Widget modified to save PNG
<?xml version="1.0" encoding="utf-8"?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions. See use restrictions in the file:
@odoe
odoe / gist:978832
Created May 18, 2011 15:40
IQueryDef sample 1
IQueryDef queryDef = workSpace.CreateQueryDef();
queryDef.Tables = "sde.Parcels, sde.Parcels_Details";
queryDef.WhereClause = "sde.Parcels.AIN = sde.Parcels_Details.AIN";
@odoe
odoe / gist:978837
Created May 18, 2011 15:42
IQueryDef sample 2
queryDef.WhereClause = "sde.Parcels.AIN = sde.Parcels_Details.AIN AND sde.Parcels.AIN = '" + ainString + "'";
@odoe
odoe / gist:978842
Created May 18, 2011 15:44
IQueryDef to IFeatureCursor sample 1
IFeatureDataset fd = workSpace.OpenFeatureQuery("sde.Parcels", queryDef); // use the IQueryDef to get an IFeatureDataset
IFeatureClassContainer fcc = fd as IFeatureClassContainer; // cast it as am IFeatureClassContainer
IFeatureClass featureClass = fcc.get_ClassByName("sde.Parcels"); // pull the IFeatureClass out of the container
IQueryFilter qf = new QueryFilterClass(); // just need an empty QueryFilter
IFeatureCursor fc = featureClass.Search(qf, false); // now I have an IFeatureCursor that I can use to access the Feature attributes and geometries
@odoe
odoe / kohtmlsample1.html
Created June 23, 2011 19:00
knockout.js to HTML binding example
<div id="osmcopy">
<a targer="_blank" data-bind="attr: {href: osmCopyURL}">
<span>OpenStreetMap</span></a>, contributors,
<a targer="_blank" data-bind="attr: {href: osmCCURL}">
<span>CC-BY-SA</span></a>
</div>
<div id="info">
<span data-bind="text: mapinfo">Extent</span>
<p/>
<ul id="details">
@odoe
odoe / dms.js
Created July 20, 2011 16:26
JavaScript method to open Hummingbird/OpenText eDocs files via Desktop Explorer
// This script is used to open files and folders
// in Hummingbird/OpenText eDocs Document Management System.
// Not the most elegant method, but the native API does not seem
// recognize how to open folders in the DMS, so I had to get old
// school and use ActiveX. Of course, this script will only work
// with Internet Explorer, so you may have to adjust security settings.
// Note: I think I can use the API to define a launch method, such as ACROBAT,
// MS WORD or even FOLDER, but I don't know how to use the API to determine which method
// to use, so ActiveX tom-foolery it is.
@odoe
odoe / QueryToken.as
Created August 2, 2011 15:28
AS3 DSL for ESRI Flex QueryTask
package net.odoe.flexmaptools.utils
{
import com.esri.ags.tasks.QueryTask;
import com.esri.ags.tasks.supportClasses.Query;
import mx.rpc.AsyncResponder;
import mx.rpc.AsyncToken;
/**
* This is an experiment in DSL for AS3.
@odoe
odoe / tilegen.js
Created August 5, 2011 21:31
Geo-Game Tile Generation in JavaScript
// still very rough
var enemyFactory = function(location) {
var rand1 = Math.floor(Math.random()*10);
var rand2 = Math.floor(Math.random()*10);
var add = function(a, b) {return a+b;};
var subtract = function(a ,b) {return a-b;};
var op = [add, subtract];
var r1 = Math.floor(Math.random()*2);
var r2 = Math.floor(Math.random()*2);
console.log("rand1", rand1);
@odoe
odoe / weborbparser.js
Created September 14, 2011 16:06
JavaScript function to parse WebOrb results to a Dojo DataGrid
/******************************************
/* Response handler that can parse
/* WebOrb (webORB.js) results and load data
/* to Dojo DataGrid
*******************************************/
function handleResponse( result )
{
var count = result.getTotalRowCount();
var colNames = result.getColumnNames();
var colCount = colNames.length;