Create _ext/
and _templates/
subdirectories.
Move edit_on_github.py
into the _ext/
subdirectory.
Move sourcelink.html
into the _templates/
subdirectory.
Add the following after the import sys, os
line
module.exports = function(Proj4js){ | |
Proj4js.defs["EPSG:3819"] = "+proj=longlat +ellps=bessel +towgs84=595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408 +no_defs"; | |
Proj4js.defs["EPSG:3821"] = "+proj=longlat +ellps=aust_SA +no_defs"; | |
Proj4js.defs["EPSG:3824"] = "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs"; | |
Proj4js.defs["EPSG:3889"] = "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs"; | |
Proj4js.defs["EPSG:3906"] = "+proj=longlat +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +no_defs"; | |
Proj4js.defs["EPSG:4001"] = "+proj=longlat +ellps=airy +no_defs"; | |
Proj4js.defs["EPSG:4002"] = "+proj=longlat +ellps=mod_airy +no_defs"; | |
Proj4js.defs["EPSG:4003"] = "+proj=longlat +ellps=aust_SA +no_defs"; | |
Proj4js.defs["EPSG:4004"] = "+proj=longlat +ellps=bessel +no_defs"; |
function toWKT(layer) { | |
var lng, lat, coords = []; | |
if (layer instanceof L.Polygon || layer instanceof L.Polyline) { | |
var latlngs = layer.getLatLngs(); | |
for (var i = 0; i < latlngs.length; i++) { | |
latlngs[i] | |
coords.push(latlngs[i].lng + " " + latlngs[i].lat); | |
if (i === 0) { | |
lng = latlngs[i].lng; | |
lat = latlngs[i].lat; |
Array | |
( | |
[hook_menu] => 6744 | |
[hook_uninstall] => 4742 | |
[hook_perm(ission)] => 4012 | |
[hook_install] => 3751 | |
[hook_theme] => 3525 | |
[hook_schema] => 3003 | |
[hook_help] => 2465 | |
[hook_form_alter] => 2273 |
function persistOnCartoDB(action,layers) { | |
var cartodb_ids=[]; | |
var geojsons=[]; | |
switch(action) { | |
case "UPDATE": | |
if(layers.getLayers().length<1) | |
return; | |
layers.eachLayer(function(layer) { |
# Bulk convert shapefiles to geojson using ogr2ogr | |
# For more information, see http://ben.balter.com/2013/06/26/how-to-convert-shapefiles-to-geojson-for-use-on-github/ | |
# Note: Assumes you're in a folder with one or more zip files containing shape files | |
# and Outputs as geojson with the crs:84 SRS (for use on GitHub or elsewhere) | |
#geojson conversion | |
function shp2geojson() { | |
ogr2ogr -f GeoJSON -t_srs crs:84 "$1.geojson" "$1.shp" | |
} |
// +proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 | |
// +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 | |
// +towgs84=0,0,0,0,0,0,0 +units=m +no_defs | |
//Allikas: https://taxofon.ee/eomap/EOMap.js | |
String destinationCordinateProjection=" +proj=lcc +lat_1=59.33333333333334 +lat_2=58 +lat_0=57.51755393055556 +lon_0=24 +x_0=500000 +y_0=6375000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"; | |
//made by example: http://augusttown.blogspot.com/2010/03/using-java-map-projection-library-in.html | |
String[] proj4_w = destinationCordinateProjection.split(" "); | |
I had previously implemented a basic styling interface, but dropped it for the time being, because of a few factors:
Basically, given that GeoJSON is taken as the language of the site, I don't want to create expectations of compatibility that won't stand - if I invent some styling language, people will expect it to work, or at least be supportable, outside of the editor, and this promise will quickly be broken. I think conceptually the way to 'fix this' is to tie styling strongly to a publish interface that can make that guarantee, and write implementations in d3/openlayers/leaflet/etc for the language if/when it exists.
A bit of a big task :) The experience of working on CartoCSS has given me a bit of appreciation/fear of the area of styling languages in general and I think they should diverge from CSS a bi
JSONP is not actually JSON with padding, it's Javascript code that's executed. JSON is not a real subset of Javascript and the way it is not is important to us: via UTFGrid, we are all UTF-8 masters.
JSONP is not safe: it's Javascript that's executed. It's trivial to XSS with JSONP, because JSONP is XSS. Just have a call like mapbox.load('foo.tilejson', …)
and if foo.tilejson
gets replaced with destroyYoursite()
, it gets run. Compare to JSON.parse, which is, on purpose, not eval.
JSONP is questionable in terms of performance. To be fast, you want to have the same callback all the time so that you can cache the response. But this leads to a page like