Creating Simple Web Map from Vector Tiles

  1. Download index.html from PKgeo’s GitHub page and save into new clean directory.
  2. Copy the previously exported style.json file into the same directory location created in step 1 above.
  3. Open style.json in a text editor.
    • Edit line 13 and 14. Change the coordinates to 47.613 and -122.3988.

      "center": [
        47.613,
        -122.3988
      ],
      
    • Make sure to enter your own Tilehosting Maps API key.

      "sources": {
       "openmaptiles": {
      "type": "vector",
      "url": "https://free.tilehosting.com/data/v3.json?key=type your API key"
       }
        },
        "sprite": "https://openmaptiles.github.io/klokantech-basic-gl-style/sprite",
        "glyphs": "https://free.tilehosting.com/fonts/{fontstack}/{range}.pbf?key=type your API key",
      
  4. Go to Bl.ock Builder
    • Click the _Start Coding+ button at the top right.
    • Click login at the top right and login with your GitHub credentials.
    • Delete the existing code in the index.html tab, and copy in the contents of your index.html file from step 1 above.
    • Press the + button at the top far right to add a new file then name it style.json.
    • Copy in the contents of your style.json file from step 2 above.
    • Click the Save button at the top.
    • Once saved, click view bl.ock and a browser new tab will open with a map view showing your Maputnik style.