<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">Hi!<br><br>I provide you my OpenLayers code.<br><br><pre class="alt2" style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 498px;">function init()<br> {<br> OpenLayers.DOTS_PER_INCH = 72;<br> <br> // --------------------------------------------------------------------------//<br> // Tableau des options pour la carte. //<br> // La plus importante est scales qui permet de definir les différents zooms //<br> // qui seront disponibles pour l'utilisateur. //<br> // --------------------------------------------------------------------------//<br> <br> var options = <br> {<br> scales: [3500000, 3000000,2500000,2000000,1500000,1000000,350000,250000],<br> maxScale: 250000,<br> minScale: 3500000,<br> controls: [new OpenLayers.Control.MouseDefaults()]<br> };<br> <br> // -------------------------//<br> // Création de l'objet map. //<br> // -------------------------//<br> <br> map = new OpenLayers.Map( 'map',options);<br> <br> // ----------------------------------------------//<br> // On ajoute les couches après les avoir créées. //<br> // ----------------------------------------------// <br> <br> layer = new OpenLayers.Layer.MapServer( "OpenLayers WMS", <br> "http://localhost/cgi-bin/mapserv?mode=map&map=/var/www/html/ms/map_files/france.map", {layers: ['FRANCE','CORSE']},<br> {gutter: 0 });<br> <br> map.addLayer(layer);<br> <br> <br> }<br><br> // -----------------------------------------------------------------------//<br> // Ajout de la barre de zoom et des coordonnées de la position actuelle. //<br> // -----------------------------------------------------------------------//<br> <br> map.addControl( new OpenLayers.Control.PanZoomBar() );<br> <br> // ------------------------------//<br> // Ajout de la gestion du click. //<br> // ------------------------------//<br> <br> var click = new OpenLayers.Control.Click();<br> map.addControl(click);<br> click.activate();<br> <br> // ---------------------------------------------------------------------------//<br> // Et on définit le centre de notre carte, afin qu'elle sot bien positionnée. //<br> // ---------------------------------------------------------------------------//<br> <br> map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);</pre><br><br>And my mapfile has the good projections block, one for the map and one for each layer. Consequently, it works with mapserver & without OL.<br><br>Regards.<br><br>Clement<br></div><br><br><br><hr id="stopSpelling">> Date: Tue, 29 Apr 2008 15:43:32 -0400<br>> From: jlacroix@mapgears.com<br>> To: clems_mars@hotmail.com<br>> CC: mapserver-users@lists.osgeo.org<br>> Subject: Re: [mapserver-users] OpenLayers & Projection<br>> <br>> Hi,<br>> <br>> You can take a look at how projection are set in OpenLayers:<br>> <br>> http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#Projections<br>> <br>> Or at the Source of the OpenLayers projection example:<br>> http://www.openlayers.org/dev/examples/projected-map.html<br>> <br>> You will also need to define the PROJECTION block at the layer level and <br>> at the map level in your mapfile.<br>> <br>> Julien<br>> <br>> PS: Please provide revelent mapfile part and revelent code when asking a <br>> question it will help us figuring out what may be your problem.<br>> <br>> Clemiou wrote:<br>> > Hi all!<br>> > <br>> > I come back here because I always have the same problem.<br>> > So, I have a .ewc file which represent the France. This file is in Lambert II (French position, centered on France).<br>> > Currently, I display this map with WGS84 projection but naturally, my map is distorded because this projection is centered on the equator.<br>> > So, if I try to displaying my map with the Lambert II projection, I obtain the following figure:<br>> > <br>> > http://www.forumsig.org/attachment.php?attachmentid=2286&stc=1&d=1208951661 <http://www.forumsig.org/attachment.php?attachmentid=2286&stc=1&d=1208951661><br>> > <br>> > As you can see, there is a malfunction=> the repetition of a part of each tile.<br>> > <br>> > I tried to add projection and units options to my map but nothing change. I think that is a OpenLayers probleme because my map is correctly display with Mapserver and without OL.<br>> > Perhaps someone here should help me.<br>> > <br>> > Thanks for your futur help and once more, excuse me for my English.<br>> > <br>> > Have a nice day<br>> > <br>> > Clement<br>> > <br>> > <br>> > ------------------------------------------------------------------------<br>> > Plus de 15 millions de français utilisent Windows Live Messenger ! <br>> > Téléchargez Messenger, c'est gratuit ! <br>> > <http://www.windowslive.fr/messenger/><br>> > <br>> > <br>> > ------------------------------------------------------------------------<br>> > <br>> > _______________________________________________<br>> > mapserver-users mailing list<br>> > mapserver-users@lists.osgeo.org<br>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users<br>> <br>> -- <br>> Julien-Samuel Lacroix<br>> Mapgears<br>> http://www.mapgears.com/<br><br /><hr />Centralisez tous vos comptes mails dans Hotmail ! <a href='http://www.windowslive.fr/hotmail/' target='_new'>Créez un compte Hotmail, c'est gratuit !</a></body>
</html>