Skip to Content
Mastering Geospatial Analysis with Python
book

Mastering Geospatial Analysis with Python

by Silas Toms, Paul Crickard, Eric van Rees
April 2018
Beginner to intermediate content levelBeginner to intermediate
440 pages
11h 36m
English
Packt Publishing
Content preview from Mastering Geospatial Analysis with Python

The web map template

Within the index.html template, the form data is accessed inside double-bracketed variables. These variables can be located inside the JavaScript or within the HTML. In this example, the form.latitude and form.longitude variables are located inside the map JavaScript that defines the initial center point of the map:

 var themap = L.map('map').setView([{{form.latitude}},                                                   {{form.longitude}}], 13);

To create the marker at the location of the arena requested, with a custom popup, the location coordinates and the popup fields are added:

  L.marker([{{form.latitude}},{{form.longitude}}]).addTo(themap)    .bindPopup("{{form.popup}}").openPopup();

To make the POST requests possible, an HTML form with a POST method houses the form.description ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Geospatial Analysis with Python

Learning Geospatial Analysis with Python

Joel Lawhead

Publisher Resources

ISBN: 9781788293334Supplemental Content