<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Thanks for this try code Oliver,<br><br>I put it in a file in myproject/htdocs/js, call it in the template and then added &lt;body onResize="repos();"&gt;&nbsp; to the template.<br>The function is called at resize (I checked it with an 'alert' ) but nothing happens,even not an error message.<br>Should I keep my css modified with margin-left=auto and margin-right=auto for the general table?<br><br>Thanks a lot<br><br>G.<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Message d'origine ----<br>De : Oliver Christen &lt;oliver.christen@camptocamp.com&gt;<br>À : guillaume champlong &lt;goutosig@yahoo.fr&gt;; carto web &lt;cartoweb-users@lists.maptools.org&gt;<br>Envoyé le :
 Lundi, 10 Mars 2008, 16h31mn 56s<br>Objet&nbsp;: Re: [Cartoweb-users] css, template, mainmap<br><br>

 
<style type="text/css">DIV {
MARGIN:0px;}
</style>


<div>
<div><font size="2">it's a bit complicated so I had a try myself,</font></div>
<div>this should do the trick</div>
<div><font size="2"></font>&nbsp;</div>
<div>&lt;body onResize="repos();"&gt;</div>
<div>&nbsp;</div>
<div>...</div>
<div>&nbsp;</div>
<div>function repos() {<br>&nbsp; var mapelm = $('map');<br>&nbsp; var posx = 
xPageX(mapelm);<br>&nbsp; var posy = xPageY(mapelm);<br>&nbsp; var rootLayer = 
mainmap.getDisplay('map').rootDisplayLayer;<br>&nbsp; xMoveTo(rootLayer, posx, 
posy);<br>&nbsp; var map = mainmap.getDisplay('map');<br>&nbsp; map._posx = 
posx;<br>&nbsp; map._posx = posx;<br>&nbsp; <br>&nbsp; if (typeof(AjaxPlugins) 
!= 'undefined'){<br>&nbsp;&nbsp;&nbsp; 
AjaxPlugins.Location.Actions.Pan.mapRootLayerTop = 
$('map_rootLayer').style.top;<br>&nbsp;&nbsp;&nbsp; 
AjaxPlugins.Location.Actions.Pan.mapRootLayerLeft = 
$('map_rootLayer').style.left;<br>&nbsp; }<br>}</div>
<div>&nbsp;</div></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
  <div style="background: rgb(228, 228, 228) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>From:</b> 
  <a rel="nofollow" title="goutosig@yahoo.fr" ymailto="mailto:goutosig@yahoo.fr" target="_blank" href="mailto:goutosig@yahoo.fr">guillaume 
  champlong</a> </div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a rel="nofollow" title="cartoweb-users@lists.maptools.org" ymailto="mailto:cartoweb-users@lists.maptools.org" target="_blank" href="mailto:cartoweb-users@lists.maptools.org">carto web</a> </div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Monday, March 10, 2008 10:33 
  AM</div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> Re : [Cartoweb-users] css, 
  template, mainmap</div>
  <div><br></div>
  <div style="font-size: 12pt; font-family: times new roman,new york,times,serif;">
  <div style="font-size: 12pt; font-family: times new roman,new york,times,serif;">thanks, 
  I'll try.<br>bye, @+<br><br>
  <div style="font-size: 12pt; font-family: times new roman,new york,times,serif;">----- 
  Message d'origine ----<br>De : Simon Georget &lt;<a rel="nofollow" ymailto="mailto:simon.georget@gmail.com" target="_blank" href="mailto:simon.georget@gmail.com">simon.georget@gmail.com</a>&gt;<br>À : 
  carto web &lt;<a rel="nofollow" ymailto="mailto:cartoweb-users@lists.maptools.org" target="_blank" href="mailto:cartoweb-users@lists.maptools.org">cartoweb-users@lists.maptools.org</a>&gt;<br>Envoyé 
  le : Lundi, 10 Mars 2008, 14h26mn 48s<br>Objet&nbsp;: Re: [Cartoweb-users] 
  css, template, mainmap<br><br>Pity, indeed..<br><br>Well, one solution would 
  be to calculate the size of the window and<br>positionning the map dynamically 
  on each resize.<br><br><br><br>On 3/10/08, Oliver Christen &lt;<a rel="nofollow" ymailto="mailto:oliver.christen@camptocamp.com" target="_blank" href="mailto:oliver.christen@camptocamp.com">oliver.christen@camptocamp.com</a>&gt; 
  wrote:<br>&gt; it should works but it wont, sadely.<br>&gt;&nbsp; because the 
  map image is positionned absolutly by the dhtml, based on the<br>&gt;&nbsp; 
  initial relative position of the map container element.<br>&gt;&nbsp; this is 
  a limitation of the actual template design.<br>&gt;<br>&gt;&nbsp; 
  regards<br>&gt;<br>&gt; Oliver<br>&gt;<br>&gt;<br>&gt;&nbsp; &gt; Hi 
  Guillaume,<br>&gt;&nbsp; &gt;<br>&gt;&nbsp; &gt; Your form is a block element 
  but the map is an image, so an inline<br>&gt;&nbsp; &gt; 
  element.<br>&gt;&nbsp; &gt;<br>&gt;&nbsp; &gt; to center an inline element you 
  should use 'text-align:center;'<br>&gt;&nbsp; &gt;<br>&gt;&nbsp; &gt; More 
  explanation here : <a rel="nofollow" target="_blank" href="http://dorward.me.uk/www/centre/">http://dorward.me.uk/www/centre/</a><br>&gt;&nbsp; 
  &gt;<br>&gt;&nbsp; &gt; It should work ....<br>&gt;&nbsp; &gt; bye, 
  simon<br>&gt;&nbsp; &gt;<br>&gt;&nbsp; &gt;<br>&gt;&nbsp; &gt;<br>&gt;&nbsp; 
  &gt; On 3/10/08, guillaume champlong &lt;<a rel="nofollow" ymailto="mailto:goutosig@yahoo.fr" target="_blank" href="mailto:goutosig@yahoo.fr">goutosig@yahoo.fr</a>&gt; 
  wrote:<br>&gt;&nbsp; &gt;&gt;<br>&gt;&nbsp; &gt;&gt; Hi all,<br>&gt;&nbsp; 
  &gt;&gt;<br>&gt;&nbsp; &gt;&gt; I am using cw3.4 on win XP pro.<br>&gt;&nbsp; 
  &gt;&gt; I have a project in which I would like the table containing the form 
  and<br>&gt;&nbsp; &gt;&gt; the<br>&gt;&nbsp; &gt;&gt; map to be centered at 
  any time. For this purpose, I added an id to this<br>&gt;&nbsp; &gt;&gt; table 
  (id=total) and in cartoweb.css I wrote<br>&gt;&nbsp; &gt;&gt; 
  #total{<br>&gt;&nbsp; &gt;&gt;&nbsp; margin-left:auto;<br>&gt;&nbsp; 
  &gt;&gt;&nbsp; margin-right:auto;<br>&gt;&nbsp; &gt;&gt; }<br>&gt;&nbsp; 
  &gt;&gt;<br>&gt;&nbsp; &gt;&gt;<br>&gt;&nbsp; &gt;&gt; Unfortunately with this 
  code, when the windows size changes, the table is<br>&gt;&nbsp; &gt;&gt; 
  re-centered<br>&gt;&nbsp; &gt;&gt; but the generated image map is not. As a 
  consequence, an offset appears<br>&gt;&nbsp; &gt;&gt; between the map and the 
  rest of the table.<br>&gt;&nbsp; &gt;&gt;<br>&gt;&nbsp; &gt;&gt; Does anyone 
  know how to fix this?<br>&gt;&nbsp; &gt;&gt; thanks<br>&gt;&nbsp; &gt;&gt; 
  G.<br>&gt;&nbsp; &gt;&gt;<br>&gt;&nbsp; &gt;&gt;&nbsp; 
  ________________________________<br>&gt;&nbsp; &gt;&gt;&nbsp; Envoyé avec 
  Yahoo! Mail.<br>&gt;&nbsp; &gt;&gt; Une boite mail plus 
  intelligente.<br>&gt;&nbsp; &gt;&gt; 
  _______________________________________________<br>&gt;&nbsp; &gt;&gt;&nbsp; 
  Cartoweb-users mailing list<br>&gt;&nbsp; &gt;&gt;&nbsp; <a rel="nofollow" ymailto="mailto:Cartoweb-users@lists.maptools.org" target="_blank" href="mailto:Cartoweb-users@lists.maptools.org">Cartoweb-users@lists.maptools.org</a><br>&gt;&nbsp; 
  &gt;&gt; <a rel="nofollow" target="_blank" href="http://lists.maptools.org/mailman/listinfo/cartoweb-users">http://lists.maptools.org/mailman/listinfo/cartoweb-users</a><br>&gt;&nbsp; 
  &gt;&gt;<br>&gt;&nbsp; &gt;&gt;<br>&gt;&nbsp; &gt;<br>&gt;&nbsp; &gt; 
  _______________________________________________<br>&gt;&nbsp; &gt; 
  Cartoweb-users mailing list<br>&gt;&nbsp; &gt; <a rel="nofollow" ymailto="mailto:Cartoweb-users@lists.maptools.org" target="_blank" href="mailto:Cartoweb-users@lists.maptools.org">Cartoweb-users@lists.maptools.org</a><br>&gt;&nbsp; 
  &gt; <a rel="nofollow" target="_blank" href="http://lists.maptools.org/mailman/listinfo/cartoweb-users">http://lists.maptools.org/mailman/listinfo/cartoweb-users</a><br>&gt;&nbsp; 
  &gt;<br>&gt;<br>&gt;<br><br>_______________________________________________<br>Cartoweb-users 
  mailing list<br><a rel="nofollow" ymailto="mailto:Cartoweb-users@lists.maptools.org" target="_blank" href="mailto:Cartoweb-users@lists.maptools.org">Cartoweb-users@lists.maptools.org</a><br><a rel="nofollow" target="_blank" href="http://lists.maptools.org/mailman/listinfo/cartoweb-users">http://lists.maptools.org/mailman/listinfo/cartoweb-users</a><br></div><br></div></div><br>
  <hr size="1">
  Envoyé avec <a rel="nofollow" target="_blank" href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52423/*http://fr.docs.yahoo.com/mail/overview/index.html">Yahoo! 
  Mail</a>.<br>Une boite mail plus intelligente. 
  <p>
  </p><SPAN style="width:100%;height:2px;border-bottom:1px solid rgb(212,208,200); border-top:1px solid rgb(128,128,128);background-color:black;overflow:hidden; margin:8px 0px;"></SPAN>

  <p></p>_______________________________________________<br>Cartoweb-users 
  mailing 
  list<br>Cartoweb-users@lists.maptools.org<br><span><a target="_blank" href="http://lists.maptools.org/mailman/listinfo/cartoweb-users">http://lists.maptools.org/mailman/listinfo/cartoweb-users</a></span><br></blockquote></div><br></div></div><br>



      <hr size="1"> 
Envoyé avec <a href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52423/*http://fr.docs.yahoo.com/mail/overview/index.html">Yahoo! Mail</a>.<br>Une boite mail plus intelligente. </a></body></html>