#1 Mon 24 November 2014 19:02
- geobrie
- Participant actif
- Date d'inscription: 31 Jan 2010
- Messages: 120
openLayers et le Framework Laravel
Bonjour,
Je suis actuellement en plein développement d'une application basée sur le framework Laravel. Dans cette application je souhaite intégrer une partie cartographie.
Pour ce faire j'ai repris mes ancienne manipulation mais malheureusement j'ai une page blanche. Basiquement je sais que ce type de soucis intervient avec des problèmes de projections mais là je pense avoir fait le tour. je vous poste mes fichiers :
Code:
MAP
NAME "MAP_TEST_MAP"
IMAGETYPE PNG24
EXTENT 1040563 6878971 1045605 6890695
SIZE 100 100
UNITS meters
IMAGECOLOR 255 255 255
IMAGEQUALITY 95
WEB
IMAGEPATH "/var/www/site/htdocs/tmp/"
IMAGEURL 'tmp/'
# WMS server settings
METADATA
'wms_title' "map_test"
'wms_onlineresource' "http://site.net/cgi-bin/mapserv?map=/home/site/www/dossier/htdocs/map_test.map&"
'wms_srs' "EPSG:2154"
"wfs_title" "map_test"
"wfs_onlineresource" "http://site.net/cgi-bin/mapserv?map=/home/site/www/dossier/htdocs/map_test.map&"
"wfs_srs" "EPSG:2154"
END###### Fin de METADATA ######
END###### Fin de WEB######
PROJECTION
"init=epsg:2154"
END###### Fin de PROJECTION ######
OUTPUTFORMAT
NAME png
DRIVER "GD/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
END###### Fin de OUTPUTFORMAT ######
###### Layer 1 #######################
LAYER
NAME map_test
STATUS ON
TYPE POLYGON
PROJECTION
"init=epsg:2154"
END
DUMP TRUE
CONNECTIONTYPE postgis
CONNECTION "dbname='base' host=site.com port=5432 user='user' password='motdepasse' sslmode=disable"
DATA "the_geom from map_test"
METADATA
### WMS
"wms_title" "map_test"
### WFS
"wfs_title" "map_test"
"gml_featureid" "gid"
"gml_include_items" "all"
END###### Fin de METADATA ######
CLASS
STYLE
color 255 255 255
outlinecolor 255 0 0
END
END
END###### Fin de Map File ######Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Carte</title>
<head>
<script src="http://openlayers.org/api/2.13.1/OpenLayers.js" type="text/javascript"></script>
<script type="text/javascript">
function init() {
var map, map_test; // (1) instanciation du constructeur
map = new OpenLayers.Map('map');
// (2) Choix des couches
var map_test = new OpenLayers.Layer.WFS( "map_test", "http://site.net/cgi-bin/mapserv?map=/home/site/www/dossier/htdocs/map_test.map&", {layers: 'map_test'});
// (3) ajout des couches a la carte
map.addLayers([map_test]);
//On zoom au max
map.zoomToMaxExtent();
}
</script>
</head>
</head>
<body onload="init()" >
<div id="map"></div>
</body>
</html>Merci pour votre aide
Hors ligne


