Skip to content

Instantly share code, notes, and snippets.

OpenLayers.Format.GeoRSS.prototype.createFeatureFromItem: function(item) {
var geometry = this.createGeometryFromItem(item);
/* Provide defaults for title and description */
var title = this.getChildValue(item, "*", "title", this.featureTitle);
/* First try RSS descriptions, then Atom summaries */
var description = this.getChildValue(
item, "*", "description",
this.getChildValue(item, "*", "content",
case 'mixed':
// The URL of the Image pinpoint icon is fetched from the 'url'
// property of the Feature
var mixedUrl = (feature.attributes.url) ? feature.attributes.url : '';
var mixedWidth = (feature.attributes.width) ? feature.attributes.width : '';
var mixedHeight = (feature.attributes.height) ? feature.attributes.height : '';
var mixedShadowUrl = (feature.attributes.shadowUrl) ? feature.attributes.shadowUrl : '';
var mixedShadowXOffset = (feature.attributes.shadowXOffset) ? feature.attributes.shadowXOffset : '';
var mixedShadowYOffset = (feature.attributes.shadowYOffset) ? feature.attributes.shadowYOffset : '';
/**
* Method: createFeatureFromItem
* Return a feature from a GeoRSS Item.
*
* Parameters:
* item - {DOMElement} A GeoRSS item node.
*
* Returns:
* {<OpenLayers.Feature.Vector>} A feature representing the item.
*/
@andrewn
andrewn / gist:216790
Created October 23, 2009 10:06
Compass
N
NW + NE
+ NNW + NNE +
+ + +
WNW + + + ENE
+ + +
W +++++++++++++++++++++++ E
+ + +
WSW + + + ESE
(function ( selector ) {
Array.prototype.slice.call( document.querySelectorAll( selector ) )
.forEach( function(it) {
it.className += " selected";
});
})(".nav-facet li, #leftHandNavMenu li");
require 'rubygems'
gem "selenium-client",">1.2.9"
require "selenium/client"
browser = Selenium::Client::Driver.new \
:host => "localhost",
:port => 4444,
:browser => "*firefox",
:url => "http://www.google.com",
var mapBounds = new OpenLayers.Bounds( -20037508.34, -20037508.34,
20037508.34, 20037508.34);
/*
Converts TMS tile coordinates to Microsoft QuadTree.
*/
function tmsToQuadTree(/* int */ tx, /* int */ ty, /* int */ zoom) {
var quadKey = [];
// ISSUE: When using VirtualEarth or Google, need to put a '0' before the quadkey
var Hash = {
/**
* Constant: URL_HASH_FACTOR
* {Float} Used to hash URL param strings for multi-WMS server selection.
* Set to the Golden Ratio per Knuth's recommendation.
*/
URL_HASH_FACTOR: (Math.sqrt(5) - 1) / 2,
/**
* Method: selectUrl
* selectUrl() implements the standard floating-point multiplicative
@andrewn
andrewn / gist:634483
Created October 19, 2010 16:15
Make ternary action explicit using variable names
var KEEP = true,
DISCARD = false,
items = this.container.get( slotClass ).filter(
function ( item ) {
return glow.dom.get( this ).hasClass( inactiveClass ) ? DISCARD : KEEP ;
}
);
1) Save the text below as /features/support/pie_chart_formatter.rb
2) Run cucumber -f PieChartFormatter
That spits out a URL with your scenario stats
-----
class PieChartFormatter
def initialize(step_mother, io, options)
 @io = io