This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Leaflet multilayer example | CartoDB.js</title> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" /> | |
<style> | |
html, body, #map { | |
height: 100%; |
This file contains 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
def CreateLayer(http, project_id, table_id, title, description, tags): | |
"""Create a styled polygon Layer from a Table; display a status when complete. | |
Args: | |
http: http, authenticated http object. | |
project_id: string, id of the GME project. | |
table_id: string, the id of the source table. | |
title: string, the title of the layer. | |
description: string, the description of the layer. | |
tags: list, list,of,tags. |
This file contains 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
// gmaps js api v2 polygon overlays -> geojson | |
overlayToGeoJSON = function(o){ | |
var feature={type:'Feature', geometry:{ type:'Polygon', coordinates:[[]]}}; | |
for (var i=0; i < o.latlngs.length; i++){ | |
feature.geometry.coordinates[0].push([o.latlngs[i].lng + o.reflng, o.latlngs[i].lat + o.reflat]) | |
} | |
feature.properties = {hint:o.hint, html: o.infohtml} | |
return feature; | |
} | |
var results={type: "FeatureCollection", features: []}; |
This file contains 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
Freebase | |
------------------ | |
Abkhazia | |
Bonaire | |
Buganda | |
Burma | |
Christmas Island | |
Cocos (Keeling) Islands | |
Collectivity of Saint Martin | |
East Timor |
This file contains 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
function highlightCorrelations(currentMarker){ | |
// first make all the airports small | |
$.each(airports, function(id, marker) { | |
marker.setIcon(getIcon(2, 'black')); | |
}); | |
// for each airport correlated to the selected airport, set it's icon to red | |
$.each(currentMarker.correlations, function(i, correlation) { | |
var marker = airports[correlation[0]]; | |
marker.setIcon(getIcon(correlation[1], 'red')); //getIcon returns a circle symbol | |
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style type="text/css"> | |
html, body, #map_canvas { height: 100%; margin: 0;} | |
</style> | |
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
<script src="https://raw.github.com/mbostock/topojson/master/topojson.js"></script> | |
<script src="https://raw.github.com/JasonSanford/GeoJSON-to-Google-Maps/master/GeoJSON.js"></script> |
This file contains 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
#!/usr/bin/env python | |
import gdal | |
import gdalnumeric | |
import sys | |
import numpy | |
# ============================================================================= | |
def Usage(): | |
print('Usage: elev2rgb.py elevation_file blue_file output_file') |
This file contains 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
#appengine python | |
values = [1,2,3,4] | |
values = array('f',values) | |
response.out.write(values.tostring()) | |
//JS loading | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', '/path/to/file', true); | |
xhr.responseType = 'arraybuffer'; |