Skip to content

Instantly share code, notes, and snippets.

💭
It's full of stars

Rene Rubalcava odoe

💭
It's full of stars
View GitHub Profile
@odoe
odoe / onswitchable.js
Created May 22, 2014
Extension of dojo/on to toggle 2 event handlers
View onswitchable.js
/*global define*/
/*jshint laxcomma:true*/
define([
'dojo/on'
], function(on) {
'use strict';
var _on = on;
_on.switchable = function(target, type, listener1, listener2) {
@odoe
odoe / adddressservice.js
Created Oct 16, 2014
AutoComplete EsriJS search widget
View adddressservice.js
define([
'dojo/_base/declare',
'dojo/_base/lang',
'dojo/Deferred',
'esri/tasks/locator'
], function(
declare, lang,
Deferred,
Locator
) {
@odoe
odoe / dojoConfig.js
Created Dec 15, 2014
override xstyle in dojoConfig
View dojoConfig.js
packages: [{
name: 'xstyle',
location: locationPath + 'vendor/xstyle'
},...
@odoe
odoe / widget.js
Created Dec 15, 2014
sample widget that loads xstyle component
View widget.js
define([
'require',
...
'./model',
'text!./templates/mywidget.tpl.html',
'xstyle/css!./css/mywidget.css'
], function(
require,
declare, lang,
_WidgetBase, _TemplatedMixin,
@odoe
odoe / widget.js
Created Dec 15, 2014
how to load xstyle css
View widget.js
define([
'xstyle/css!./css/widget.css'
], function(){
// ...
});
@odoe
odoe / widget.css
Created Dec 15, 2014
xstyle widget component
View widget.css
#popup-message {
model = module('widgets/mywidget/model');
=>
div.esriSimpleSlider {
text-align: left !important;
padding:25px;
}
label 'State Name',
input.form-control[placeholder=Search...][type=text](model/value) {
on-keyup: model/updateValue(event);
@odoe
odoe / model.js
Created Dec 15, 2014
xstyle model
View model.js
define([
'esri/tasks/FindTask',
'esri/tasks/FindParameters',
'esri/graphicsUtils'
], function(
FindTask, FindParameters, gUtils
) {
var model = {
map: undefined,
@odoe
odoe / bower.json
Created Dec 15, 2014
xstyle config
View bower.json
{
"name": "Esri-JS-xstyle",
"version": "0.0.1",
"dependencies": {
"xstyle": "master"
},
"resolutions": {
"xstyle": "master"
}
}
@odoe
odoe / PouchDBStore.js
Last active Aug 29, 2015
A PouchDB Store for use with Dojo/ArcGIS JS applications
View PouchDBStore.js
define([
'dojo/Deferred',
'dojo/_base/declare',
'dojo/_base/array',
'dojo/store/util/QueryResults',
'pouchdb/pouchdb'
], function (
Deferred,
declare, arrayUtil,
QueryResults,
@odoe
odoe / sample.js
Created Dec 22, 2014
Sample of how to use PouchDBStore with FeatureLayer
View sample.js
selectedTemplate.featureLayer.applyEdits(newAdds, null, null)
.then(function() {
db.getAll().then(function(results) {
console.debug('results', results);
var graphics = results.map(function(r) { return new Graphic(r.doc.item); });
var docs = results.map(function(r) { return r.doc; });
selectedTemplate.featureLayer.applyEdits(graphics).then(function() {
docs.map(function(doc) {
db.delete(doc);
});
You can’t perform that action at this time.