map data from a drupal feed
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
joelondon f346c83497 try cors-anywhere 3 years ago
.standard-cache ๐Ÿ๐Ÿ’ฝ Checkpoint 5 years ago
public try cors-anywhere 3 years ago
src colour contrast on buttons 4 years ago
.babel.json ๐Ÿ๐Ÿ’ฝ Checkpoint 5 years ago
.babelrc ๐Ÿ๐Ÿ’ฝ Checkpoint 5 years ago
.gitignore tabindex 4 years ago
.glitch-assets ๐Ÿ‘†๐Ÿ‘จโ€โค๏ธโ€๐Ÿ‘จ Checkpoint 4 years ago
.prettierrc ๐Ÿš๐Ÿš› Checkpoint 4 years ago
.v8flags.6.2.414.75.d41d8cd98f00b204e9800998ecf8427e.json ๐Ÿ‘ด๐ŸŽ Checkpoint 4 years ago
.wget-hsts ๐Ÿ‘ด๐ŸŽ Checkpoint 4 years ago
CODE_OF_CONDUCT.md ๐Ÿ๐Ÿ’ฝ Checkpoint 5 years ago
README.md ๐Ÿ‘–๐Ÿš  Checkpoint 4 years ago
gulpfile.js ๐Ÿ๐Ÿ’ฝ Checkpoint 5 years ago
package-lock.json accessibility much better 4 years ago
package.json ๐Ÿš๐Ÿš› Checkpoint 4 years ago
server.js accessibility much better 4 years ago
shrinkwrap.yaml ๐Ÿš๐Ÿš› Checkpoint 4 years ago

README.md

small sites

trello card

suggestions feature service

small_site_suggestions_service_01

submissions feature layer

user submissions, in the form of points (or boundaries)

  {
    "Site Ref": "auto",
    "Site Name / Description": "eg site next to school playground",
    "Ideas and Suggestions": "Why have you have suggested this location? How could it be developed? Do you have a local connection?",
    "Capacity": "Roughly, how many homes could fit here?",
    "Postcode": "",
    "Borough": "",
    "Lat": "",
    "Long": "",
    "Acres": "",
    "Hectares": "",
    "Contact email": "In case we need to follow-up with you",
    "Would you be in a position to develop this site?": "y/n",
    "Date Submitted": ""
  }

clearing test features

this service accepts user added features

during testing, to clear all features - run the following curl command:

curl 'https://maps.london.gov.uk/gla/rest/services/apps/small_site_suggestions_service_01/FeatureServer/0/deleteFeatures' -H 'Cookie: __cfduid=d056efa5ddcb722fe9b3c6ac78a71e3351512140697' -H 'Origin: https://maps.london.gov.uk' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-GB,en-US;q=0.9,en;q=0.8' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36 OPR/49.0.2725.39' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: https://maps.london.gov.uk/gla/rest/services/apps/small_site_suggestions_service_01/FeatureServer/0/deleteFeatures' -H 'Connection: keep-alive' --data 'objectIds=&where=1%3D1&geometry=&geometryType=esriGeometryEnvelope&inSR=&spatialRel=esriSpatialRelIntersects&gdbVersion=&rollbackOnFailure=true&f=json' --compressed ;

cors

note the london.gov.uk servers running the page that embeds this have enabled cors for this traffic

previously we had considered a server side proxy written in python or node

node modules used

express

this is a very simple node app using express for a little routing via server.js

babel

this app is written in ES6, and uses babel to output ES5 compatible js (for IE11)

it uses a simple .babelrc which just removes the use strict directive and chooses ES5 (env preset)

{
  "presets": [
      ["env", { "modules": false }]
    ]
}

note some ES6 features such as for...of are not transferable without additional polyfills configured; one solution is to just use an old fashioned i indexed for loop

gulp

this app also uses gulpfile.js to copy html and js from the src to public directory, changing the link accordingly (use the gulp deploy command)

standard

standard is used to lint js and apply some of its code conventions

beautify

js-beautify is used to indent (ideally a tab is two spaces but this isn't configured here)

npm

package.json is how the packages are coordinated by npm, which also determines the autostart option and project metadata

"start": "babel public/js -d public/babel && gulp deploy && node server.js"

more layers

features to archived on an ad hoc basis in cooperation with team

other public land layer

map service from arcgis server

drupal feature layer

live feed

test feed

http://geojson.io/#id=gist:joelondon/f4981ba03a6808112112462ca9830e0d&map=4/51.47/25.85

Presented in lat/lon, web mercator (undeclared) projection or EPSG:3785 (osm) or EPSG:4326 (leaflet)

esri plugin

NOTE the first image in field_small_site_images (carousel list) is the one to show in the popup.

  {
    type: "Feature",
    -geometry: {
    type: "Point",
    -coordinates: (2)[
    0.1784,
    51.4184
    ]
    },
    -properties: {
      name: "Cook Road Junction - Plot 001",
      description: "Vacant tarmacked plot opposite Colliers Wood tube station...",
      nid: 40631,
      path: https://wwwtest.london.gov.uk/what-we-do/housing-and-land/land-and-development/small-sites-small-builders/cook-road-junction-plot,
      field_hero_image: https://wwwtest.london.gov.uk/sites/default/files/styles/gla_2_1_medium/public/trees_carbon.jpeg?itok=0UyArHGL,
      field_ideal_for: "A small high quality scheme with commercial space",
      field_short_title: "Plot001 - 0.08",
      field_site_acres: 0.08,
      field_site_address: "194-194 High Street, Colliers Wood, SW19 2BN",
      field_site_borough: "Barking and Dagenham",
      field_site_landowner: "Transport for London / London Underground Ltd (freehold)",
      field_site_reference: "P001",
      field_site_sites_type: null,
      field_site_status: "Submit by",
      field_small_site_images: "https://wwwtest.london.gov.uk/sites/default/files/styles/gla_2_1_medium/public/river-lea_0.jpg?itok=SgdvMh_O, https://wwwtest.london.gov.uk/sites/default/files/styles/gla_2_1_medium/public/aerial-tower-bridge.jpg?itok=ZW8uklDV, https://wwwtest.london.gov.uk/sites/default/files/styles/gla_2_1_medium/public/birdseye_view.jpg?itok=vVsKmmAy, https://wwwtest.london.gov.uk/sites/default/files/styles/gla_2_1_medium/public/city2520hall2520at2520night_jpg.jpg?itok=XHn3f2sr",
      field_submission_closing_date: "2017-10-17 15:04:00"
    }
  }