Implementation of Jarke J. van Wijk and Wim A.A. Nuij's smooth and efficient zooming and panning for Polymaps.
Type a place name in the search box, top right, and hit "Go!" to fly there.
| function loadCSV(url, columns, callback) { | |
| var req = new XMLHttpRequest(); | |
| req.open('GET', url, true); | |
| req.onreadystatechange = function (aEvt) { | |
| if (req.readyState == 4) {// && req.status == 200) { | |
| callback(parseCSV(req.responseText, columns)); | |
| } | |
| }; | |
| req.send(null); | |
| } |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Modest Maps JS</title> | |
| <script type="text/javascript"> | |
| /*! | |
| * Modest Maps JS v0.13.2X (fork for gist) | |
| * http://modestmaps.com/ | |
| * |
| http://www.win.tue.nl/~vanwijk/zoompan.pdf for Modest Maps JS |
Implementation of Jarke J. van Wijk and Wim A.A. Nuij's smooth and efficient zooming and panning for Polymaps.
Type a place name in the search box, top right, and hit "Go!" to fly there.
| // node.js geo polygon map tile rendering! | |
| // requires https://github.com/learnboost/node-canvas and GeoJSON data files | |
| // e.g. | |
| // data from naturalearthdata.com converted to GeoJSON with GDAL's ogr2ogr | |
| // or from datasf.org, reprojected too: | |
| // ogr2ogr -f GeoJSON sfbay.js sfbay.shp -t_srs EPSG:4326 | |
| var Canvas = require('./vendor/node-canvas/lib/canvas'), | |
| http = require('http'), | |
| fs = require('fs'); |
| // Node.js as an alertnative to Lisp ;-) | |
| // see http://norvig.com/java-lisp.html | |
| // and http://www.flownet.com/ron/papers/lisp-java/instructions.html | |
| // all we need from node.js is file reading | |
| var fs = require('fs'); | |
| // mappings from characters to digits |
| import processing.core.*; | |
| import com.modestmaps.core.*; | |
| import com.modestmaps.geo.*; | |
| public class OpenStreetMapProvider extends AbstractMapProvider { | |
| public String[] subdomains = new String[] { "", "a.", "b.", "c." }; | |
| public OpenStreetMapProvider() { |
| // | |
| // TextField.h | |
| // | |
| // Created by Tom Carden on 8/9/11. | |
| // Copyright 2011 Bloom Studio, Inc. All rights reserved. | |
| // | |
| #pragma once | |
| #include <string> |
| /* | |
| Copyright (c) 2010, The Barbarian Group | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without modification, are permitted provided that | |
| the following conditions are met: | |
| * Redistributions of source code must retain the above copyright notice, this list of conditions and | |
| the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and |
| var MM = require('modestmaps'), | |
| Canvas = require('canvas'), | |
| Image = Canvas.Image; | |
| get = require('get'), | |
| express = require('express'); | |
| function renderStaticMap(provider, dimensions, zoom, location, callback) { | |
| var canvas = new Canvas(dimensions.x, dimensions.y), | |
| ctx = canvas.getContext('2d'); |