[Cartoweb-users] css, template, mainmap
guillaume champlong
goutosig at yahoo.fr
Tue Mar 11 00:11:15 EDT 2008
Thanks for this try code Oliver,
I put it in a file in myproject/htdocs/js, call it in the template and then added <body onResize="repos();"> to the template.
The function is called at resize (I checked it with an 'alert' ) but nothing happens,even not an error message.
Should I keep my css modified with margin-left=auto and margin-right=auto for the general table?
Thanks a lot
G.
----- Message d'origine ----
De : Oliver Christen <oliver.christen at camptocamp.com>
À : guillaume champlong <goutosig at yahoo.fr>; carto web <cartoweb-users at lists.maptools.org>
Envoyé le : Lundi, 10 Mars 2008, 16h31mn 56s
Objet : Re: [Cartoweb-users] css, template, mainmap
DIV {
MARGIN:0px;}
it's a bit complicated so I had a try myself,
this should do the trick
<body onResize="repos();">
...
function repos() {
var mapelm = $('map');
var posx = xPageX(mapelm);
var posy = xPageY(mapelm);
var rootLayer = mainmap.getDisplay('map').rootDisplayLayer;
xMoveTo(rootLayer, posx, posy);
var map = mainmap.getDisplay('map');
map._posx = posx;
map._posx = posx;
if (typeof(AjaxPlugins) != 'undefined'){
AjaxPlugins.Location.Actions.Pan.mapRootLayerTop = $('map_rootLayer').style.top;
AjaxPlugins.Location.Actions.Pan.mapRootLayerLeft = $('map_rootLayer').style.left;
}
}
----- Original Message -----
From: guillaume
champlong
To: carto web
Sent: Monday, March 10, 2008 10:33 AM
Subject: Re : [Cartoweb-users] css, template, mainmap
thanks, I'll try.
bye, @+
----- Message d'origine ----
De : Simon Georget <simon.georget at gmail.com>
À : carto web <cartoweb-users at lists.maptools.org>
Envoyé le : Lundi, 10 Mars 2008, 14h26mn 48s
Objet : Re: [Cartoweb-users] css, template, mainmap
Pity, indeed..
Well, one solution would be to calculate the size of the window and
positionning the map dynamically on each resize.
On 3/10/08, Oliver Christen <oliver.christen at camptocamp.com> wrote:
> it should works but it wont, sadely.
> because the map image is positionned absolutly by the dhtml, based on the
> initial relative position of the map container element.
> this is a limitation of the actual template design.
>
> regards
>
> Oliver
>
>
> > Hi Guillaume,
> >
> > Your form is a block element but the map is an image, so an inline
> > element.
> >
> > to center an inline element you should use 'text-align:center;'
> >
> > More explanation here : http://dorward.me.uk/www/centre/
> >
> > It should work ....
> > bye, simon
> >
> >
> >
> > On 3/10/08, guillaume champlong <goutosig at yahoo.fr> wrote:
> >>
> >> Hi all,
> >>
> >> I am using cw3.4 on win XP pro.
> >> I have a project in which I would like the table containing the form and
> >> the
> >> map to be centered at any time. For this purpose, I added an id to this
> >> table (id=total) and in cartoweb.css I wrote
> >> #total{
> >> margin-left:auto;
> >> margin-right:auto;
> >> }
> >>
> >>
> >> Unfortunately with this code, when the windows size changes, the table is
> >> re-centered
> >> but the generated image map is not. As a consequence, an offset appears
> >> between the map and the rest of the table.
> >>
> >> Does anyone know how to fix this?
> >> thanks
> >> G.
> >>
> >> ________________________________
> >> Envoyé avec Yahoo! Mail.
> >> Une boite mail plus intelligente.
> >> _______________________________________________
> >> Cartoweb-users mailing list
> >> Cartoweb-users at lists.maptools.org
> >> http://lists.maptools.org/mailman/listinfo/cartoweb-users
> >>
> >>
> >
> > _______________________________________________
> > Cartoweb-users mailing list
> > Cartoweb-users at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/cartoweb-users
> >
>
>
_______________________________________________
Cartoweb-users mailing list
Cartoweb-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/cartoweb-users
Envoyé avec Yahoo!
Mail.
Une boite mail plus intelligente.
_______________________________________________
Cartoweb-users mailing list
Cartoweb-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/cartoweb-users
_____________________________________________________________________________
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20080311/190cbd03/attachment.html
More information about the Cartoweb-users
mailing list