HTML and CSS Reference
In-Depth Information
Figure 6-2. Dataset modification in Opera 11.1 with Dragonfly
6.6 Example: Creating a Map Application Using Custom Data
Problem
You want to generate markers on a map using custom data attributes.
Solution
Store the latitudes and longitudes of the locations you wish to show on the map in
separate custom data attributes. Then write JavaScript to access those datasets and
render markers on the map:
<!DOCTYPE html>
<html>
<head>
<title>Map example</title>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false"></script>
<style type="text/css">
#map { height:500px; width:500px; border:1px solid #000; }
</style>
 
Search WWH ::




Custom Search