Shelters in Aarhus

Embedded via Open Data Aarhus.

However it’s possible to download the json from the page: shelters.json. If you can import the json to Mapbox then … kaboom!

Mapbox cannot import the shelters.json file. Try to remove this line:

"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },

Save your file and bingo! Now you have a dataset.

  1. In mapbox import the file shelters.json
  2. Export the datalayer as a tile.
  3. In your map use the tile as a layer.
  4. That’s it.

Here’s thee result in the Mapbox studio:

Editing Shelters in Aarhus in Mapbox
Editing Shelters in Aarhus in Mapbox. Click to see the live sample.

Now you can embed the map in your CMS or on a web page. If you work in WordPress the next step could be a custom page or post with the image loading open data from Aarhus – or to create a plugin with a shortcode that will display your map. Follow the recipe here.

 

 

WordPress and REST API

The newest version of WordPress came with a REST API. It will revolutionize the ways we think about themes. You don’t have to use PHP any more. With HTML, CSS and JavaScript you can get content via Json.

What is REST API?

The very short version is: WordPress will return Json objects from certain endpoints. Here’s a sample:

yourWordPressSite.nu/wp-json/wp/v2/posts

A URL like this will return a Json object with the 10 most recent¬†post. Why don’t you try it in your browser:

http://multimusen.dk/wp-json/wp/v2/posts

But what’s the fuzz all about? Well JavaScript can transmute Json to content on a web page. So now you may program your frontend via JavaScript. This is really good news for Nodejs-developers. But in fact you may develop your web page in any language, that’s able to manipulate Json.

REST API is much more that reading content. You can create, read, update and delete content on the server.

 

With the REST API WordPress will open the gates to a very interesting future. Perhaps themes as we know them will be obsolete in the near future. Even the Dashboard could be something in the past.

Bang the drums, and hoist the flags! WordPress  with REST API is here.