<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi</FONT></DIV>
<DIV><FONT size=2>The map extent (or bbox) is set once and for all in the 
mapfile. This is the value used in all cases.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>To restrict an area for a user, you will need to dynamicaly 
modify the </FONT><FONT size=3>EXTENT value of the mapfile.</FONT></DIV>
<DIV><FONT size=2>You can easily do that by extending the location 
coreplugin:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>class ServerRestrictedLocation extends ServerLocation 
{</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;public function replacePlugin() 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 
'location';<BR>&nbsp;&nbsp;&nbsp; }</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;&nbsp;&nbsp; public function initializeRequest($request) 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $msMapObj = 
$this-&gt;serverContext-&gt;getMapObj();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$minx = 452100; $miny = 5213328; $maxx = 606706; $maxy = 
5321475;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$msMapObj-&gt;setExtent($minx,$miny,$maxx,$maxy);<BR>&nbsp;&nbsp;&nbsp; 
}</FONT></DIV>
<DIV><FONT size=2>}</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>But you will also need to define an&nbsp;</FONT><FONT 
size=2>initialMapStates so the initial view is also limited to the extend you 
want.</FONT></DIV>
<DIV>
<DIV><FONT size=2>initialMapStates are defined in 
/server_conf/*your*project*/*your*project*.ini</FONT></DIV>
<DIV><FONT size=2>For example: 
mapInfo.initialMapStates.A_NAME_FOR_THIS_MAPSTATE.location.bbox = "452100, 
5213328, 606706, 5321475"</FONT></DIV>
<DIV><FONT size=2>Then this is called via 
"initialState=A_NAME_FOR_THIS_MAPSTATE" in the url</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>The implementation above is a bit crude, you noticed I put the 
$minx,$miny,$maxx,$maxy in hard in the function initializeRequest.</FONT></DIV>
<DIV><FONT size=2>To do it correctly, you need to pass the selected 
initialMapStates bbox from client side to server side and recover that value via 
$selectedBbox = 
$request-&gt;some_new_parameter_with_the_selected_bbox_value;</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>To get the selected initialMapStates bbox values on client 
side, do $bbox = 
$this-&gt;cartoclient-&gt;getInitialMapState()-&gt;location-&gt;bbox;</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>For passing value from client to server side, see the examples 
in the wiki's HowTo (<A 
href="http://www.cartoweb.org/cwiki/HowToDisplayOnTheMapAPointFromADatabaseQuery">http://www.cartoweb.org/cwiki/HowToDisplayOnTheMapAPointFromADatabaseQuery</A>)</FONT></DIV>
<DIV><FONT size=2>the idea is the parameter is set on client side via 
buildRequest(), it must be defined in the restrictedLocation/common/Location.php 
file and you can recover it from most of the functions on server side. <A 
href="http://www.cartoweb.org/doc/misc/plugins_diagram.pdf">http://www.cartoweb.org/doc/misc/plugins_diagram.pdf</A></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>regards</FONT></DIV>
<DIV><FONT size=2>Oliver</FONT></DIV></DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=appora@gmail.com href="mailto:appora@gmail.com">E. 
  Appora-Gnékindy</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A 
  title=oliver.christen@camptocamp.com 
  href="mailto:oliver.christen@camptocamp.com">Oliver Christen</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A 
  title=cartoweb-dev@lists.maptools.org 
  href="mailto:cartoweb-dev@lists.maptools.org">cartoweb-dev@lists.maptools.org</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, May 08, 2008 3:32 
PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Cartoweb-dev] Programmatic Map 
  display</DIV>
  <DIV><BR></DIV>Thanks a lot Oliver, I took a look a the edit plugin and I 'll 
  definitey use it. <BR>Another requirement of our project is that volunteers be 
  assigned a and shown only a given section of an image to work on. This seems 
  to require a programmatic map display. I am not sure how to do this with 
  static parameters in the mapfile configuration. <BR>Any ideas on how to handle 
  this?<BR><BR>Best,<BR><BR>Eloi<BR><BR>
  <DIV class=gmail_quote>2008/5/8 Oliver Christen &lt;<A 
  href="mailto:oliver.christen@camptocamp.com">oliver.christen@camptocamp.com</A>&gt;:<BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV bgcolor="#ffffff">
    <DIV><FONT size=2>Hi</FONT></DIV>
    <DIV><FONT size=2></FONT>&nbsp;</DIV>
    <DIV><FONT size=2>use the edit plugin, it will save the point, line or 
    polygones in a postgis database.</FONT></DIV>
    <DIV><FONT size=2>see the demo&nbsp;<A 
    href="http://www.cartoweb.org/demos/demoEdit.php" 
    target=_blank>http://www.cartoweb.org/demos/demoEdit.php</A> and the usage 
    manual <A href="http://www.cartoweb.org/cwiki/HowToUseTheEdition" 
    target=_blank>http://www.cartoweb.org/cwiki/HowToUseTheEdition</A></FONT></DIV>
    <DIV><FONT size=2></FONT>&nbsp;</DIV>
    <DIV><FONT size=2>regards</FONT></DIV>
    <DIV><FONT size=2>Oliver</FONT></DIV>
    <BLOCKQUOTE 
    style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px">
      <DIV>
      <DIV></DIV>
      <DIV class=Wj3C7c>
      <DIV 
      style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal">----- 
      Original Message ----- </DIV>
      <DIV 
      style="BACKGROUND: rgb(228,228,228) 0% 50%; FONT: 10pt arial; font-size-adjust: none; font-stretch: normal; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><B>From:</B> 
      <A title=appora@gmail.com href="mailto:appora@gmail.com" target=_blank>E. 
      Appora-Gnékindy</A> </DIV>
      <DIV 
      style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>To:</B> 
      <A title=cartoweb-dev@lists.maptools.org 
      href="mailto:cartoweb-dev@lists.maptools.org" 
      target=_blank>cartoweb-dev@lists.maptools.org</A> </DIV>
      <DIV 
      style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Sent:</B> 
      Thursday, May 08, 2008 2:26 PM</DIV>
      <DIV 
      style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Subject:</B> 
      [Cartoweb-dev] Customizing the Outline plugin for 
geo-databasequeries</DIV>
      <DIV><BR></DIV>Hello,<BR><BR>I am working on a volunteer-based project 
      that would use Map Server, Cartoweb and PostGIS. The prpject would use 
      volunteers on the Internet to look at sattelite imagery over the African 
      continent and identify feature such as roads, fileds , bridges etc. These 
      will be saved in a PostGIS geodatabase.<BR><BR>Basically, users would draw 
      points, lines and polylines on the map shown to them. My task is to write 
      a cartoweb plugin to save the result in PostGIS. <BR>Currently, features 
      drawn with&nbsp; the outline plugin seem to be persistent only for the 
      current session. We want the plugin&nbsp; to save figures drawn on the map 
      into the database for future use. <BR>If someone has ideas on how this can 
      be achieved, I would be very 
      grateful.<BR><BR>Regards,<BR>Eloi<BR><BR>University of Bangui<BR>Central 
      African Republic<BR clear=all><BR></DIV></DIV>
      <P></P>
      <HR>

      <P></P>_______________________________________________<BR>Cartoweb-dev 
      mailing list<BR><A href="mailto:Cartoweb-dev@lists.maptools.org" 
      target=_blank>Cartoweb-dev@lists.maptools.org</A><BR><A 
      href="http://lists.maptools.org/mailman/listinfo/cartoweb-dev" 
      target=_blank>http://lists.maptools.org/mailman/listinfo/cartoweb-dev</A><BR></BLOCKQUOTE></DIV></BLOCKQUOTE></DIV><BR><BR 
  clear=all><BR>-- <BR>E. Appora-Gnékindy Ngagnan<BR>Laboratoire 
  d'Informatique<BR>Faculté des Sciences<BR>Université de Bangui 
  <BR><BR>Tel.:+236 75 56 77 38 </BLOCKQUOTE></BODY></HTML>