[mapserver-commits] r7830 - in trunk/mapserver_demos/samples: . relative_positioning

svn at osgeo.org svn at osgeo.org
Tue Jul 22 23:38:08 EDT 2008


Author: sdlime
Date: 2008-07-22 23:38:08 -0400 (Tue, 22 Jul 2008)
New Revision: 7830

Added:
   trunk/mapserver_demos/samples/relative_positioning/
   trunk/mapserver_demos/samples/relative_positioning/index.html
   trunk/mapserver_demos/samples/relative_positioning/sample.map
Modified:
   trunk/mapserver_demos/samples/samples.js
   trunk/mapserver_demos/samples/samples_config.js
Log:
Added relative positioning sample.

Added: trunk/mapserver_demos/samples/relative_positioning/index.html
===================================================================
--- trunk/mapserver_demos/samples/relative_positioning/index.html	                        (rev 0)
+++ trunk/mapserver_demos/samples/relative_positioning/index.html	2008-07-23 03:38:08 UTC (rev 7830)
@@ -0,0 +1,34 @@
+<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: Relative positioning allows you to draw features (most often defined inline) relative to something other than the
+    upper left-hand corner of the image. For example, you might want to always place a copyright statement in the lower left-hand
+    corner of a map regardless of image size. A layer's TRANSFORM property is used to define relative positioning (default is UL).
+    Feature coordinates can be given in pixels, the default, or in percentages (doubles between 0 and 1).</p> 
+
+    <p>Output:<br>
+<script language="javascript">
+  var url = samples_mapserver + "?map=" + samples_location + "relative_positioning/sample.map&mode=map";
+  document.write("<a target=new href=\"" + url + "\"><img alt=\"open in new window\" src=\"" + url + "\"></a>"); 
+
+  // smaller image
+  url = samples_mapserver + "?map=" + samples_location + "relative_positioning/sample.map&mode=map&mapsize=150+200";
+  document.write("<a target=new href=\"" + url + "\"><img alt=\"open in new window\" src=\"" + url + "\"></a>"); 
+
+  // larger image
+  url = samples_mapserver + "?map=" + samples_location + "relative_positioning/sample.map&mode=map&mapsize=400+250";
+  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/relative_positioning/sample.map
===================================================================
--- trunk/mapserver_demos/samples/relative_positioning/sample.map	                        (rev 0)
+++ trunk/mapserver_demos/samples/relative_positioning/sample.map	2008-07-23 03:38:08 UTC (rev 7830)
@@ -0,0 +1,105 @@
+#
+# MapServer Sample
+#   Title: Relative Positioning
+#   Author: Steve Lime
+#
+MAP
+  NAME 'relative_positioning'
+  EXTENT 0 0 500 500
+  SIZE 300 300
+  
+  IMAGECOLOR 225 225 225
+
+  SYMBOL
+    NAME 'circle'
+    TYPE ELLIPSE
+    POINTS 1 1 END
+    FILLED TRUE
+  END
+
+  LAYER
+    NAME 'border'
+    TYPE LINE
+    TRANSFORM FALSE
+    UNITS PERCENTAGES
+    FEATURE 
+      POINTS 0 0 0 1 1 1 1 0 0 0 END
+    END
+    STATUS DEFAULT
+    CLASS
+      STYLE
+        COLOR 0 0 0
+      END
+    END
+  END
+
+  LAYER
+    NAME 'point1'
+    TYPE POINT
+    TRANSFORM FALSE
+    FEATURE
+      POINTS 50 50 END
+      TEXT 'ul:(50,50):px'
+    END
+    STATUS DEFAULT
+    CLASS
+      STYLE
+        SYMBOL 'circle'
+        COLOR 212 255 255
+        SIZE 13
+      END
+      LABEL
+        COLOR 0 0 0
+        OUTLINECOLOR 255 255 255
+        SIZE TINY
+      END
+    END
+  END
+
+  LAYER
+    NAME 'point2'
+    TYPE POINT
+    TRANSFORM LR
+    FEATURE
+      POINTS -50 -50 END
+      TEXT 'lr:(-50,-50):px'
+    END
+    STATUS DEFAULT
+    CLASS
+      STYLE
+        SYMBOL 'circle'
+        COLOR 212 255 255
+        SIZE 13
+      END
+      LABEL
+        COLOR 0 0 0
+        OUTLINECOLOR 255 255 255
+        SIZE TINY
+      END
+    END
+  END
+
+  LAYER
+    NAME 'point3'
+    TYPE POINT
+    TRANSFORM LL
+    UNITS PERCENTAGES
+    FEATURE
+      POINTS .25 -.4 END
+      TEXT 'll:(.25,-.4):%'
+    END
+    STATUS DEFAULT
+    CLASS
+      STYLE
+        SYMBOL 'circle'
+        COLOR 212 255 255
+        SIZE 13
+      END
+      LABEL
+        COLOR 0 0 0
+        OUTLINECOLOR 255 255 255
+        SIZE TINY
+      END
+    END
+  END
+END

Modified: trunk/mapserver_demos/samples/samples.js
===================================================================
--- trunk/mapserver_demos/samples/samples.js	2008-07-23 03:04:40 UTC (rev 7829)
+++ trunk/mapserver_demos/samples/samples.js	2008-07-23 03:38:08 UTC (rev 7830)
@@ -5,9 +5,7 @@
                 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' },
+                url: 'relative_positioning/index.html',
                 description: 'Positioning of features relative to places in an image (e.g. lower left corner).',
                 keywords: ['inline features', 'relative position']}
 ];

Modified: trunk/mapserver_demos/samples/samples_config.js
===================================================================
--- trunk/mapserver_demos/samples/samples_config.js	2008-07-23 03:04:40 UTC (rev 7829)
+++ trunk/mapserver_demos/samples/samples_config.js	2008-07-23 03:38:08 UTC (rev 7830)
@@ -2,7 +2,7 @@
 //
 // location on this system for the samples
 //
-var samples_location = '/Users/sdlime/samples/';
+var samples_location = '/Users/sdlime/mapserver_demos/samples/';
 
 //
 // url for MapServer on this system



More information about the mapserver-commits mailing list