This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Arel | |
class TwitterArray | |
include Relation | |
attr_reader :array, :attribute_names_and_types | |
include Recursion::BaseCase | |
ATTR_MAP = { | |
:twitter_name => Attributes::String, | |
:id => Attributes::Integer, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (T) - Twitter Updates | |
# id = Arel::Attributes::Integer.new nil, :id | |
# update = Arel::Attributes::String.new nil, :update | |
# tuples = [[1, "Hai I can haz cheezburgerz"], [2, "Nom!"], [0, "What can you haz?"]] | |
# headers = [Arel::Attributes::Integer.new(nil, :id), Arel::Attributes::String.new(nil, :update)] | |
# updates = Arel::Array.new tuples, headers | |
# find_twitter_user_updates_predicate = Arel::Predicates::Equality.new updates[:id], 9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from http://blog.portable-eggplant.org/2007/02/13/ruby-polyline-encoder-for-google-maps/ | |
class EncodedPolyline | |
attr_reader :points, :encoded_points, :encoded_levels | |
def initialize(points, culling_level = 0) | |
@points = points | |
points = [] | |
for point in @points | |
points << Hash["lat" => point.y, "long" => point.x, "lev" => "unset"] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PolylineEncoder.js copyright Mark McClure April/May 2007 | |
// | |
// This software is placed explicitly in the public | |
// domain and may be freely distributed or modified. | |
// No warranty express or implied is provided. | |
// | |
// History: | |
// V 2.1 July 2007 | |
// Minor modification in distance function to enhance | |
// speed. Suggested by Joel Rosenberg. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.maker.models | |
{ | |
public class EncodedPolyline { | |
private static var instance:EncodedPolyline; | |
public function EncodedPolyline() {} | |
private static function _decodeLine(encoded:String):Array { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add to routes.rb | |
# Needed for responding to OPTIONS http method | |
map.connect '*path', | |
:controller => 'home', | |
:action => 'options_for_mopd', | |
:conditions => {:method => :options} | |
# in home_controller.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://geocommons.com/javascripts/f1.api.js" type="text/javascript"></script> | |
<style type="text/css" media="screen"> | |
#map {width: 100%; height: 400px;} | |
</style> | |
<div id="embed_map"></div> | |
<div id="results"></div> | |
<script type="text/javascript" charset="utf-8"> | |
var mymap = new F1.Maker.Map({ | |
map_id: 48852, | |
dom_id: "embed_map", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mymap.getLayers(); | |
var layers = mymap.getLayers(); | |
// Ouput: | |
// layers = [ | |
// { | |
// title: "My First Layer", | |
// source: "finder:45", | |
// styles: {...}, | |
// opacity: 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mymap.setStyle({legend:{buttonBgColor:0xFF00FF,buttonPlacement:"vertical",buttonFontColor:0x000000,buttonBgAlpha:1,offset:{x:30,y:0}}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mymap.setStyle({zoom:{ bgColor:0x000000,iconColor:0xFFFFFF, bgAlpha:0.5, expanded:false, dropShadow:false, offset:{x:30,y:0},width:40}}) |