[mapserver-commits] r7829 - in trunk/mapserver_demos: . samples samples/hello_world

svn at osgeo.org svn at osgeo.org
Tue Jul 22 23:04:40 EDT 2008


Author: sdlime
Date: 2008-07-22 23:04:40 -0400 (Tue, 22 Jul 2008)
New Revision: 7829

Added:
   trunk/mapserver_demos/samples/
   trunk/mapserver_demos/samples/hello_world/
   trunk/mapserver_demos/samples/hello_world/index.html
   trunk/mapserver_demos/samples/hello_world/sample.map
   trunk/mapserver_demos/samples/samples.css
   trunk/mapserver_demos/samples/samples.html
   trunk/mapserver_demos/samples/samples.js
   trunk/mapserver_demos/samples/samples_config.js
   trunk/mapserver_demos/samples/samples_filter.html
   trunk/mapserver_demos/samples/samples_list.html
   trunk/mapserver_demos/samples/samples_window.html
Log:
Initial commit of the new MapServer samples demo.

Added: trunk/mapserver_demos/samples/hello_world/index.html
===================================================================
--- trunk/mapserver_demos/samples/hello_world/index.html	                        (rev 0)
+++ trunk/mapserver_demos/samples/hello_world/index.html	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1,23 @@
+<html>
+  <head>
+    <title>Hello World</title>
+    <link rel="STYLESHEET" href="../samples.css" type="text/css">
+    <script language="javascript" src="../samples_config.js"></script>
+  </head>
+  <body>
+    <div id="samples_window">
+
+    <p>Files: <a href="sample.map">sample.map</a></p>
+
+    <p>Notes:</p> 
+
+    <p>Output:<br>
+<script language="javascript">
+  var url = samples_mapserver + "?map=" + samples_location + "hello_world/sample.map&mode=map";
+  document.write("<a target=new href=\"" + url + "\"><img alt=\"open in new window\" src=\"" + url + "\"></a>"); 
+</script>
+    </p>
+
+    </div>
+  </body>
+</html>

Added: trunk/mapserver_demos/samples/hello_world/sample.map
===================================================================
--- trunk/mapserver_demos/samples/hello_world/sample.map	                        (rev 0)
+++ trunk/mapserver_demos/samples/hello_world/sample.map	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1,29 @@
+#
+# MapServer Sample
+#   Title: Hello World
+#   Author: Steve Lime
+#
+MAP
+  NAME 'hello_world'
+  EXTENT 0 0 500 500
+  SIZE 300 300
+  
+  IMAGECOLOR 225 225 225
+
+  LAYER
+    NAME 'hello_world'
+    TYPE ANNOTATION
+    FEATURE
+      POINTS 250 250 END
+      TEXT 'Hello World!'
+    END
+    STATUS DEFAULT
+    CLASS
+      LABEL
+        COLOR 0 0 0
+        OUTLINECOLOR 255 255 255
+        SIZE MEDIUM
+      END
+    END
+  END
+END

Added: trunk/mapserver_demos/samples/samples.css
===================================================================
--- trunk/mapserver_demos/samples/samples.css	                        (rev 0)
+++ trunk/mapserver_demos/samples/samples.css	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1,48 @@
+body {
+  background:#FFFFFF none repeat scroll 0%;
+  color:#000000;
+  font-family:"Lucida Grande",Verdana,Geneva,Lucida,Arial,Helvetica,sans-serif;
+  font-size:80%;
+  margin:0px;
+}
+
+#samples_filter {
+  padding:5px;
+  background-color:#EEEEEE;  
+}
+
+#samples_window {
+  padding:5px;
+  background-color:#FFFFFF;
+}
+
+#samples_window img {
+  padding:5px;
+  border:0px;
+}
+
+.sample_title {
+  font-size:100%;
+  font-weight:bold;
+}
+
+#samples_list {
+  border-right: thin dotted #222222;
+}
+
+#samples_list a {
+  width:100%;
+  display:block;
+  color:#000;
+  padding:5px;
+  text-decoration:none;
+  border-bottom: thin dotted #222222;
+}
+
+#samples_list a:hover {
+  background-color:#EEEECC;
+}
+
+form {
+  padding:5px;
+}
\ No newline at end of file

Added: trunk/mapserver_demos/samples/samples.html
===================================================================
--- trunk/mapserver_demos/samples/samples.html	                        (rev 0)
+++ trunk/mapserver_demos/samples/samples.html	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1,11 @@
+<html>
+<head>
+  <title>MapServer Samples</title>
+</head>
+<frameset rows="65,*">
+  <frame name="samples_filter" src="samples_filter.html" scrolling=no frameborder=0>
+  <frameset cols="250,*">
+    <frame name="samples_list" src="samples_list.html" scrolling=auto frameborder=0>
+    <frame name="samples_window" src="samples_window.html" scrolling=auto frameborder=0>
+  </frameset>
+</frameset>

Added: trunk/mapserver_demos/samples/samples.js
===================================================================
--- trunk/mapserver_demos/samples/samples.js	                        (rev 0)
+++ trunk/mapserver_demos/samples/samples.js	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1,45 @@
+
+var samples = [
+               {title: 'Hello World',
+                url: 'hello_world/index.html',
+                description: 'Places the text \'Hello World!\" in an image.',
+                keywords: ['inline features', 'annotation']},
+               {title: 'Relative Positioning',
+                url: samples_mapserver,
+                args: { map: samples_location + 'relative_positioning/sample.map',
+	                mode: 'map' },
+                description: 'Positioning of features relative to places in an image (e.g. lower left corner).',
+                keywords: ['inline features', 'relative position']}
+];
+
+function launchSample(i) {
+  var url = samples[i].url;
+
+  var sep = '?';
+  for (var key in samples[i].args) {
+    url += sep + key + '=' + escape(samples[i].args[key]);
+    sep = '&';
+  }
+
+  parent.samples_window.location.href = url;
+}
+
+function displaySamples(name, filter) {
+  var element = document.getElementById(name);
+  element.innerHTML = '';
+
+  for(var i=0; i<samples.length; i++) {
+    if(filter) {
+
+    }
+
+    var content = "<div class=\"sample_container\">";
+    content += "<a href=\"javascript:launchSample(" + i + ")\">";
+    content += "<span class=\"sample_title\">" + samples[i].title + "</span><br>";
+    content += "<span class=\"sample_description\">" + samples[i].description + "</span>";
+
+    element.innerHTML += content;
+  }
+
+  // element.innerHTML += '</samples>';
+}

Added: trunk/mapserver_demos/samples/samples_config.js
===================================================================
--- trunk/mapserver_demos/samples/samples_config.js	                        (rev 0)
+++ trunk/mapserver_demos/samples/samples_config.js	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1,10 @@
+
+//
+// location on this system for the samples
+//
+var samples_location = '/Users/sdlime/samples/';
+
+//
+// url for MapServer on this system
+//
+var samples_mapserver = 'http://localhost/cgi-bin/mapserv';

Added: trunk/mapserver_demos/samples/samples_filter.html
===================================================================
--- trunk/mapserver_demos/samples/samples_filter.html	                        (rev 0)
+++ trunk/mapserver_demos/samples/samples_filter.html	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1,13 @@
+<html>
+  <head>
+    <link rel="STYLESHEET" href="samples.css" type="text/css">
+  </head>
+  <body>
+    <div id="samples_filter">
+       <b>MapServer Samples</b> - Simple examples that hilite specific MapServer functionality.<br>
+       <form>
+         Filter by keyword: <input type=text width=30>
+       </form>
+    </div>
+  </body>
+</html>

Added: trunk/mapserver_demos/samples/samples_list.html
===================================================================
--- trunk/mapserver_demos/samples/samples_list.html	                        (rev 0)
+++ trunk/mapserver_demos/samples/samples_list.html	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1,10 @@
+<html>
+  <head>
+    <link rel="STYLESHEET" href="samples.css" type="text/css">
+    <script language="javascript" src="samples_config.js"></script>
+    <script language="javascript" src="samples.js"></script>
+  </head>
+  <body onLoad="displaySamples('samples_list')">
+    <div id="samples_list"></div>
+  </body>
+</html>

Added: trunk/mapserver_demos/samples/samples_window.html
===================================================================
--- trunk/mapserver_demos/samples/samples_window.html	                        (rev 0)
+++ trunk/mapserver_demos/samples/samples_window.html	2008-07-23 03:04:40 UTC (rev 7829)
@@ -0,0 +1 @@
+<!-- blank for now -->



More information about the mapserver-commits mailing list