|
From: <lgr...@us...> - 2006-11-02 21:40:59
|
Revision: 14
http://svn.sourceforge.net/mapaphoto/?rev=14&view=rev
Author: lgrammel
Date: 2006-11-02 13:40:31 -0800 (Thu, 02 Nov 2006)
Log Message:
-----------
#1584398 tutorial how to use map-a-photo
Modified Paths:
--------------
homepage/trunk/index.html
Added Paths:
-----------
homepage/trunk/data.xml
homepage/trunk/img_1351.jpg
homepage/trunk/img_1367.jpg
homepage/trunk/img_1585.jpg
homepage/trunk/maps.html
Added: homepage/trunk/data.xml
===================================================================
--- homepage/trunk/data.xml (rev 0)
+++ homepage/trunk/data.xml 2006-11-02 21:40:31 UTC (rev 14)
@@ -0,0 +1,12 @@
+<data>
+ <location lat="48.42163954540473" lng="-123.36807489395142" name="Empress Hotel">
+ <picture file="img_1351.jpg" date="2006-10-09 08:00" />
+ <picture file="img_1585.jpg" date="2006-10-14 10:30" />
+ </location>
+ <location lat="48.422878432029876" lng="-123.3815610408783" name="Fishermans Wharf">
+ <picture file="img_1367.jpg" date="2006-10-09 09:00" />
+ <text date="2006-10-14 17:45" >
+ Some text...
+ </text>
+ </location>
+</data>
\ No newline at end of file
Property changes on: homepage/trunk/data.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: homepage/trunk/img_1351.jpg
===================================================================
(Binary files differ)
Property changes on: homepage/trunk/img_1351.jpg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: homepage/trunk/img_1367.jpg
===================================================================
(Binary files differ)
Property changes on: homepage/trunk/img_1367.jpg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: homepage/trunk/img_1585.jpg
===================================================================
(Binary files differ)
Property changes on: homepage/trunk/img_1585.jpg
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Modified: homepage/trunk/index.html
===================================================================
--- homepage/trunk/index.html 2006-11-02 21:34:03 UTC (rev 13)
+++ homepage/trunk/index.html 2006-11-02 21:40:31 UTC (rev 14)
@@ -8,6 +8,10 @@
<a href="http://maps.google.com" target="_blank">Google Maps</a>
using some Java Script code provided by this open source project. If you have any questions, please
contact us in the <a href="http://sourceforge.net/forum/forum.php?forum_id=624485">project forums</a>.
+ <h2>Online example</h2>
+ <p>
+ <a href="maps.html">online example</a>.
+ </p>
<h2>Downloading the example</h2>
<p>
You can download "examples.zip" containing a short example at <a href="http://sourceforge.net/project/showfiles.php?group_id=180175&package_id=208293">project download page</a>.
Added: homepage/trunk/maps.html
===================================================================
--- homepage/trunk/maps.html (rev 0)
+++ homepage/trunk/maps.html 2006-11-02 21:40:31 UTC (rev 14)
@@ -0,0 +1,98 @@
+<!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">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+ <title>Victoria Visit October 2006</title>
+ <script src="http://maps.google.com/maps?file=api&v=2.65&key=ABQIAAAAUSQ19DnbWFmnXLrOTDG68hS_Tt0sRp8JIPwu3ajpkRGTVkv8fxSlw9yBlQEoZkJarxyvJoU2Y96FFQ"
+ type="text/javascript"></script>
+ <script type="text/javascript">
+
+ //<![CDATA[
+
+var INFO_COLUMN_WIDTH = 300;
+
+function createImage(picture) {
+ var date = picture.getAttribute("date");
+ return date + "<div><a href=\""+ picture.getAttribute("file")+"\" target='blank'><img border='0' src=\""+ picture.getAttribute("file")+"\" width=\"" + INFO_COLUMN_WIDTH + "\"/></a></div>";
+}
+
+function createText(element) {
+ var date = element.getAttribute("date");
+ var text = element.firstChild.data;
+ return date + "<br/><div style='width:" + INFO_COLUMN_WIDTH + "px'>" + text + "</div>";
+}
+
+ function load() {
+ // element holen, window.innerWidth setzen
+ var element = document.getElementById("map");
+
+ element.style="position:absolute; top:0px; left:0px; width: "+(window.innerWidth-INFO_COLUMN_WIDTH)+"px; height: "+window.innerHeight+"px;";
+ document.getElementById("info").style="position:absolute; top:0px; left:"+(window.innerWidth-INFO_COLUMN_WIDTH)+"px; width: "+INFO_COLUMN_WIDTH+"px; height: "+window.innerHeight+"px;overflow:auto;";
+
+ if (GBrowserIsCompatible()) {
+ var map = new GMap2(element);
+
+ map.addControl(new GLargeMapControl());
+ map.addControl(new GMapTypeControl());
+
+ map.setCenter(new GLatLng(48.44673890596188, -123.38882446289062), 12);
+
+ GDownloadUrl("data.xml", function(data, responseCode) {
+ var xml = GXml.parse(data);
+ var markers = xml.documentElement.getElementsByTagName("location");
+
+ for (var i = 0; i < markers.length; i++) {
+ createMarker(markers[i],map);
+ }
+
+ });
+
+ // getting the location
+ GEvent.addListener(map, "click", function(marker, point) {
+ document.getElementById("info").innerHTML = "<location lat=\"" + point.y + "\" lng=\"" + point.x + "\" name=\"\" ></location>" ;
+ });
+
+// map.setMapType(G_HYBRID_MAP);
+ map.setMapType(G_SATELLITE_MAP);
+ }
+
+
+function createMarker(marker,map) {
+ var point = new GLatLng(parseFloat(marker.getAttribute("lat")),parseFloat(marker.getAttribute("lng")));
+ var name = marker.getAttribute("name");
+ var pictures = marker.childNodes;
+ var infoTabs = [ new GInfoWindowTab("#", "<b>" + name + "</b><br/>click on marker for more!") ];
+ var gmarker = new GMarker(point);
+ GEvent.addListener(gmarker, "mouseover", function() {
+ gmarker.openInfoWindowTabsHtml(infoTabs);
+ });
+ GEvent.addListener(gmarker, "mouseout", function() {
+ map.getInfoWindow().hide();
+ });
+ GEvent.addListener(gmarker, "click", function() {
+ var infoElement = document.getElementById("info");
+ var content = "<b>"+name +"</b><br/>";
+ for (var j = 0; j < pictures.length; j++) {
+ if (pictures[j].nodeName == "picture") {
+ content = content + createImage(pictures[j]);
+ } else if (pictures[j].nodeName == "text") {
+ content = content + createText(pictures[j]);
+ }
+ }
+ infoElement.innerHTML = content;
+ });
+ map.addOverlay(gmarker);
+}
+
+ }
+
+ //]]>
+ </script>
+ </head>
+ <body onload="load()" onunload="GUnload()" style="background: #FFFFFF">
+ <div id="map"></div>
+ <div id="info"></div>
+ <div id="message"></div>
+ </body>
+</html>
Property changes on: homepage/trunk/maps.html
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|