Recently I am learning a geospatial course at my home university, and I am also building a simple web application as exercise.

Following is an incomplete memo of what I have learned along the way.

  • Leaflet.js is a good library for building map related applications. and you should check it out at https://github.com/Leaflet/Leaflet
  • A basic code snippet of using leaflet.This creates a new map on DOM element whose id equals to “map” (which is usually a simple div), and add a basic Open Street Map base layer.
map = L.map('map').setView([1.3569, 103.7779], 12);

L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);