[LUGOS] Prikaz podatkov iz MySQL-a na internetu
Matija Grabnar
matija+lugos at serverflow.com
Sun Sep 7 20:49:03 CEST 2008
Damir Dezeljin wrote:
> BTW: Prej sem napisal geografski podatki - razmisljal sem, da bi to
> prikazal na kaksni mapci kot npr. Google Maps. Ima kdo izkusnje s tem?
Aja, evo primer za google maps (iz
http://code.google.com/apis/maps/documentation/examples/ )
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example: Map Markers</title>
<script
src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAzr2EBOXUKnm_jVnk0OJI7xSosDVG8KKPE1-m51RBrvYughuyMxQ-i1QfUnH94QxWIa6N4U6MouMmBA"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
// Add 10 markers to the map at random locations
var bounds = map.getBounds();
var southWest = bounds.getSouthWest();
var northEast = bounds.getNorthEast();
var lngSpan = northEast.lng() - southWest.lng();
var latSpan = northEast.lat() - southWest.lat();
for (var i = 0; i < 10; i++) {
var point = new GLatLng(southWest.lat() + latSpan * Math.random(),
southWest.lng() + lngSpan *
Math.random());
map.addOverlay(new GMarker(point));
}
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>
</body>
</html>
Za tisti key, ki je uporabljen v zacetnem URLju, se bos moral
registrirati pri googlu, ampak kolikor se spominjam, je postopek precej
neproblematicen.
Lep pozdrav,
Matija
More information about the lugos-list
mailing list