How to do it...

Carry out the following steps:

  1. Create a new HTML file and name it leaflet.html (available in the book source code package). Open it and add the <head> and <body> tags. In the <head> section, import the Leaflet CSS and JavaScript libraries and the jQuery JavaScript library (you will use jQuery to send an AJAX request to the GetFeatureInfo from the MapServer WMS):
        <html> 
          <head> 
            <title>Leaflet Example</title>             <link rel="stylesheet"              href= "https://unpkg.com/leaflet@1.2.0/dist/leaflet.css" />             <script src= "https://unpkg.com/leaflet@1.2.0/dist/leaflet.js">            </script>             <script src="http://ajax.googleapis.com/ajax/                    libs/jquery/1.9.1/jquery.min.js">            </script> 
          </head> 
          <body> 
          </body> 
        </html> 
  1. Start adding a <div> tag in the <body> ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.