the html is fairly basic boilerplate for a full screen map, but the JavaScript file includes the data as well as the code to display it, in production we'd probably want to serve that as jsonp. This can be entirely self hosted internally, except the tiles which are hosted by mapquest in this example and we'd have to render our own tiles if we wanted to host them.
var app = require('express').createServer(), | |
mbtiles = require('mbtiles'), | |
tilelive = new (require('tilelive').Server)(mbtiles); | |
app.get('/:z/:x/:y.*', function(req, res) { | |
var options = { | |
x: req.param('x'), | |
y: req.param('y'), | |
z: req.param('z'), | |
format: req.params[0], |
function toGeoJSON(data){ | |
var outPut = { "type": "FeatureCollection", | |
"features": []}; | |
var fl = data.features.length; | |
var i = 0; | |
while(fl>i){ | |
var ft = data.features[i]; | |
/* as only ESRI based products care if all the features are the same type of geometry, check for geometry type at a feature level*/ | |
var outFT = { | |
"type": "Feature", |
large geojson dataset mapped using geojquery, in chrome, but weirdly enough, not in IE9 the overlay doesn't quite keep up with the map when it pans.
this is like the other example but since it has a larger dataset we start zoomed in farther, and reload the data every time the viewpoint changes instead of loading all of it when the map loads.
design the new avid geo site in your framework of choice, can your rails beat the (Java|Coffee)script of the node hipsters? and what about all that smack talk I hear between the Django and Flask kids? bonus points for
- Obscurity: CoffeeScript would get more points then JavaScript, Coco would get even more, but the framework you wrote that compiles Haskell to lolcode would win.
- Hipsterocity: this is probably going to mean your going to need to involve mustaches
- Overengineering: why use something as passe as nosql to store comments when you can write an Octree based storage engine where nodes communicate over a distributed hash table, or how about storing post tags as edges on a [hypergraph](http://en.wikipedia.org/wiki/Hyperg
So your most likely going to be iterating through an array or an object, we'll start with an array;
var array = [1,2,3,4,5]; //your array
for(var i = 0; i<array.lengh; i++){
doStuff(array[i]);
}
the only issue with that is that you are checking the length of the array every time, so instead you could do
{ | |
"types":[ | |
"ABBOTTSWOOD", | |
"ACCESS", | |
"ACRES", | |
"AFIELD", | |
"ALLEY", | |
"ANNEX", | |
"APPROACH", | |
"ARBORWAY", |