Pages: 1
- Sujet précédent - (Openlayers) probleme de projection / superposition Google map - Sujet suivant
#1 Tue 30 June 2009 10:33
- BJH
- Juste Inscrit !
- Date d'inscription: 21 Jul 2008
- Messages: 2
(Openlayers) probleme de projection / superposition Google map
Bonjour,
Après de vaines tentatives et un bon écumage des sujets s'y rapportant je viens chercher de l'aide.
Je construit actuellement un webmapping sur les bases mapfish/openlayers/mapserver dans lequel je souhaite superposer des couches de limites administratives a celles de googlemap.
Mon problème est que lors de l'affichage de ma couche (polygon) dans openlayers, celle-ci se retrouve comme aplatie. J'ai essayé de les reprojeter via ogr2ogr en 4326 puis 900913 mais rien n'y fait. pourtant quand j'affiche ces mêmes couches dans un SIG type mapinfo ou openjump, celles-ci ne sont plus déformées. J'avoue n'y comprendre plus grand chose. comme si openlayers appliquait une projection conforme qui m'aplatirait mes couches ...
Je vous fais suivre mes différents fichiers :
mapfile
Code:
MAP
NAME "drome"
EXTENT 517282.576164 5483324.009693 648839.938699 5675748.565234
SIZE 400 600
STATUS ON
PROJECTION
"init=epsg:4326"
"init=epsg:900913"
END
UNITS meters
SHAPEPATH "./data/"
IMAGECOLOR 255 255 255
IMAGEQUALITY 200
IMAGETYPE PNG
OUTPUTFORMAT
NAME "PNG"
DRIVER "GD/PNG"
MIMETYPE "image/png"
#IMAGEMODE PC256
EXTENSION "png"
END
QUERYMAP
SIZE 200 200
STATUS ON
STYLE HILITE
COLOR 255 0 0
END
WEB
IMAGEPATH "http://localhost/tmp/"
IMAGEURL "/tmp/"
METADATA
"wms_title" "server"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/serveurl02/www/webmap/site/mapdrome5.map&"
"wms_srs" "EPSG:4326"
END
END
LAYER
NAME "webmap"
TYPE POLYGON
DATA "drome1"
METADATA
"wms_title" "shape8"
END
STATUS DEFAULT
PROJECTION
"init=epsg:4326"
END
CLASS
NAME "webmap"
STYLE
SYMBOL 0
SIZE 1
OUTLINECOLOR 250 250 250
COLOR 50 150 207
END
END
END
ENDet mon index.html :
Code:
<script type="text/javascript">
// reference local blank image
Ext.BLANK_IMAGE_URL = '../../mfbase/ext/resources/images/default/s.gif';
Ext.onReady(function(){
var map = new OpenLayers.Map($('olmap'));
var layer = new OpenLayers.Layer.WMS( "les communes de la drome",
"http://localhost/cgi-bin/mapserv?map=/serveurl02/www/webmap/site/mapdrome5.map&",
{srs: '4326', layers: 'webmap', transparent: true}, {isBaseLayer: false}, {sphericalMercator: true}
);
var gphy = new OpenLayers.Layer.Google(
"Google Physical",
{type: G_PHYSICAL_MAP}, {sphericalMercator: true}
);
map.addLayers([layer, gphy]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.PanZoomBar());
map.addControl(new OpenLayers.Control.Permalink());
map.addControl(new OpenLayers.Control.Permalink('permalink'));
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(new OpenLayers.Control.OverviewMap());
map.addControl(new OpenLayers.Control.KeyboardDefaults());
var newl = new OpenLayers.Layer.Text( "text", { location:"./epi.txt"} );
map.addLayer(newl);
if (!map.getCenter()) {
map.setCenter(new OpenLayers.LonLat(3.93408, 44.59151), 9);
};Y aurait-il une solution miracle a mon problème ?
...---...
Merci d'avance
Dernière modification par BJH (Tue 30 June 2009 10:35)
Hors ligne
Pages: 1
- Sujet précédent - (Openlayers) probleme de projection / superposition Google map - Sujet suivant


