From 1f67b74ae3db662a5923cacd073987c25aaa1ef1 Mon Sep 17 00:00:00 2001 From: Eric Sherman Date: Thu, 20 Apr 2017 12:09:28 -0500 Subject: [PATCH 1/6] update config --- js/userconfig.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/userconfig.js b/js/userconfig.js index 453a487..7d49402 100644 --- a/js/userconfig.js +++ b/js/userconfig.js @@ -10,10 +10,10 @@ var config = { north : 42.453, east : -70.95, //Mapbox access token & key for basemap - mapboxAccessToken : - 'pk.eyJ1IjoicmVtb3RlZ2VudHJpZnkiLCJhIjoiY2lnanJzMjJpMDA1dnYxbHo5MTZtdGZsYSJ9.gLE8d40zmDAtMSSZyd2h1Q', + mapboxAccessToken : + 'pk.eyJ1IjoiZWFzaGVybWEiLCJhIjoiY2oxcW51Nzk2MDBkbTJxcGUxdm85bW5xayJ9.7mL0wQ7cjifWwt5DrXMuJA', //Change to your username, insert function on cartodb, and cartodb tablename (see also /cartoDB_functions) - cartoDBusername : 'raphaeld', + cartoDBusername : 'easherma', cartoDBinsertfunction : 'insert_bikeways_data', walkthroughWelcome: "

This webmap allows you to view data collected by the Boston Cyclists Union on biking in Boston.

It also allows you to submit input on where biking infrastructure can be improved by drawing on the map! The map is restricted to the inner core of Metro Boston, where we concentrate our advocacy.

" -}; \ No newline at end of file +}; From 2ae2c37b9392b1aaf31233c468546f3af480f92b Mon Sep 17 00:00:00 2001 From: Eric Sherman Date: Thu, 20 Apr 2017 12:24:28 -0500 Subject: [PATCH 2/6] https --- index.html | 156 ++++++++++++++++++++++++++--------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/index.html b/index.html index 045d050..3e41f70 100644 --- a/index.html +++ b/index.html @@ -16,8 +16,8 @@ - - + + @@ -25,23 +25,23 @@ - + - + - +
- +
- -
+ +
    @@ -54,7 +54,7 @@
-
+
    @@ -92,44 +92,44 @@ From 6e3d8f31e6f82e0b9aa8d10edc4ae200f2ffca97 Mon Sep 17 00:00:00 2001 From: Eric Sherman Date: Thu, 20 Apr 2017 12:38:11 -0500 Subject: [PATCH 3/6] convert to https --- index.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index 3e41f70..375fed2 100644 --- a/index.html +++ b/index.html @@ -104,9 +104,8 @@ L.control.zoom({position : 'bottomleft'}).addTo(map); //Positron basemap - var CartoDB_PositronNoLabels = L.tileLayer('http[s]://cartodb-basemaps-{s}.global.ssl.fastly.net/{style}/{z}/{x}/{y}.png', { - attribution: '© OpenStreetMap © CartoDB', - subdomains: 'abcd', + var CartoDB_PositronNoLabels = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_nolabels/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap, © CARTO', maxZoom: 19 }); CartoDB_PositronNoLabels.addTo(map); @@ -143,8 +142,8 @@ //Adding layer of labels - var labelLayer = L.tileLayer('http://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}.png', { - "attribution": '© CartoDB', + var labelLayer = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/light_only_labels/{z}/{x}/{y}.png', { + "attribution": '© CARTO', "maxzoom": 17, "minzoom": 13, "pane":"markerPane"}).addTo(map); @@ -490,7 +489,7 @@ //Sending the data $.ajax({ type: 'POST', - url: 'https://'+config.cartoDBusername+'.cartodb.com/api/v2/sql', + url: 'https://'+config.cartoDBusername+'.carto.com/api/v2/sql', crossDomain: true, data: {"q":sql}, dataType: 'json', From c417d2ce7d2e63f492023378598f7d54350fbaf7 Mon Sep 17 00:00:00 2001 From: Eric Sherman Date: Thu, 20 Apr 2017 12:54:02 -0500 Subject: [PATCH 4/6] rename notes to description --- cartoDB_functions/insert_function.sql | 16 ++++++++-------- index.html | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cartoDB_functions/insert_function.sql b/cartoDB_functions/insert_function.sql index d77c2ed..7b75934 100644 --- a/cartoDB_functions/insert_function.sql +++ b/cartoDB_functions/insert_function.sql @@ -3,26 +3,26 @@ DROP FUNCTION IF EXISTS insert_bikeways_data(text,text,text,text); CREATE OR REPLACE FUNCTION insert_bikeways_data ( _geojson TEXT, - _notes TEXT, + _description TEXT, _name TEXT, _zip TEXT) --Has to return something in order to be used in a "SELECT" statement RETURNS integer AS $$ -DECLARE +DECLARE _the_geom GEOMETRY; BEGIN - --Convert the GeoJSON to a geometry type for insertion. - _the_geom := ST_SetSRID(ST_GeomFromGeoJSON(_geojson),4326); + --Convert the GeoJSON to a geometry type for insertion. + _the_geom := ST_SetSRID(ST_GeomFromGeoJSON(_geojson),4326); - EXECUTE ' INSERT INTO bikeways (the_geom, notes, name, zipcode) + EXECUTE ' INSERT INTO bikeways (the_geom, description, name, zipcode) VALUES ($1, $2, $3, $4) - ' USING _the_geom, _notes, _name, _zip; - + ' USING _the_geom, _description, _name, _zip; + RETURN 1; END; $$ LANGUAGE plpgsql SECURITY DEFINER ; --Grant access to the public user -GRANT EXECUTE ON FUNCTION insert_bikeways_data(text,text,text,text) TO publicuser; \ No newline at end of file +GRANT EXECUTE ON FUNCTION insert_bikeways_data(text,text,text,text) TO publicuser; diff --git a/index.html b/index.html index 375fed2..f62a482 100644 --- a/index.html +++ b/index.html @@ -498,6 +498,7 @@ }, error: function (responseData, textStatus, errorThrown) { + console.log(responseData); console.log("Problem saving the data"); } From 140e537551ea5a232a618630bde0a70ebc7ed078 Mon Sep 17 00:00:00 2001 From: Eric Sherman Date: Thu, 20 Apr 2017 13:23:15 -0500 Subject: [PATCH 5/6] modify bounds, extent to illinois --- index.html | 6 +++--- js/userconfig.js | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index f62a482..70c55a2 100644 --- a/index.html +++ b/index.html @@ -11,8 +11,8 @@ - - + + @@ -99,7 +99,7 @@ var bounds = L.latLngBounds(L.latLng(config.south,config.west), L.latLng(config.north,config.east)); var map = L.map('map', { center: config.mapFocus, - zoom: 13, minZoom : 13, maxzoom: 17, maxBounds : bounds, zoomControl :false }); + zoom: 7, minZoom : 7, maxzoom: 19, maxBounds : bounds, zoomControl :false }); map.touchZoom.enable(); L.control.zoom({position : 'bottomleft'}).addTo(map); diff --git a/js/userconfig.js b/js/userconfig.js index 7d49402..ca5ecd7 100644 --- a/js/userconfig.js +++ b/js/userconfig.js @@ -4,11 +4,11 @@ var config = { //Set Map Bounds & point map is centered around - mapFocus : [42.381899, -71.122499], - south : 42.24 , - west : -71.27, - north : 42.453, - east : -70.95, + mapFocus : [41.68932225997044, -88.11035156249999], + south : 36.73888412439431 , + west : -91.7138671875, + north : 42.71473218539458, + east : -87.1875, //Mapbox access token & key for basemap mapboxAccessToken : 'pk.eyJ1IjoiZWFzaGVybWEiLCJhIjoiY2oxcW51Nzk2MDBkbTJxcGUxdm85bW5xayJ9.7mL0wQ7cjifWwt5DrXMuJA', From 3fdc37bae2f71c0cf9545f652d0cb8b0ae1762f0 Mon Sep 17 00:00:00 2001 From: Eric Sherman Date: Thu, 20 Apr 2017 13:27:47 -0500 Subject: [PATCH 6/6] change intro text --- js/userconfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/userconfig.js b/js/userconfig.js index ca5ecd7..04d9554 100644 --- a/js/userconfig.js +++ b/js/userconfig.js @@ -15,5 +15,5 @@ var config = { //Change to your username, insert function on cartodb, and cartodb tablename (see also /cartoDB_functions) cartoDBusername : 'easherma', cartoDBinsertfunction : 'insert_bikeways_data', - walkthroughWelcome: "

    This webmap allows you to view data collected by the Boston Cyclists Union on biking in Boston.

    It also allows you to submit input on where biking infrastructure can be improved by drawing on the map! The map is restricted to the inner core of Metro Boston, where we concentrate our advocacy.

    " + walkthroughWelcome: "

    This webmap allows you to submit input on where critical rural freight coordiors can be improved by drawing on the map. It also allows you to view relevant data we have collected.

    " };