Leaflet - Quickstart: Unterschied zwischen den Versionen
Aus Wikizone
| Zeile 1: | Zeile 1: | ||
=== Grundstruktur === | === Grundstruktur === | ||
| − | Leaflet CSS | + | # Leaflet CSS einbinden |
| + | # Leaflet JS File einbinden | ||
| + | # HTML Map Div Element einbauen. Es sollte eine Höhenangabe über CSS definiert sein. | ||
| + | # Leaflet Map Objekt für das Div initialisieren. Im Beispiel wird auf | ||
<pre> | <pre> | ||
| Zeile 14: | Zeile 17: | ||
<body> | <body> | ||
<div id="map" style="height:180px;"></div> | <div id="map" style="height:180px;"></div> | ||
| + | <script'> | ||
| + | var map = L.map('map').setView([51.505, -0.09], 13); | ||
| + | </script> | ||
</body> | </body> | ||
</html> | </html> | ||
</pre> | </pre> | ||
Version vom 18. Oktober 2012, 07:21 Uhr
Grundstruktur
- Leaflet CSS einbinden
- Leaflet JS File einbinden
- HTML Map Div Element einbauen. Es sollte eine Höhenangabe über CSS definiert sein.
- Leaflet Map Objekt für das Div initialisieren. Im Beispiel wird auf
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.4/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.4/leaflet.js"></script>
</head>
<body>
<div id="map" style="height:180px;"></div>
<script'>
var map = L.map('map').setView([51.505, -0.09], 13);
</script>
</body>
</html>