I understand how to set my WMS, KML layers to turn on by default in the API and how to adjust opacity etc., but how to I control the Geoportal default layers?
In the below linked example I want to have Cadastral on by default (as start upand have 100% opacity)...
http://www.wm.edu/as/cga/Online%20GI...Maps/index.php
I know the commands
visibility: true
Opacity: 1
but I do not understand where to put these lines of code to work on the Cadastral Layer (or any of the Geoportal layers such as Buildings, Cadastral, Hydrography)
To summarize.
I can alter Visibilty and Opacity on my WMS layers and I can alter them as a user on the client but how in my code below would I set Cadastral to be on by default as startup (checked) and have 100% Opacity.
Many Thanks
Stu
Below is my code
<title>API Geoportail - votre carte personnelle</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://api.ign.fr/geoportail/api?v=1.0&key=2298977541674719491&instance=VISU">
<!-- -->
</script>
<script type="text/javascript">
<!--
function initGeoportalMap() {
geoportalLoadVISU("GeoportalVisuDiv");
// geoportalLoadVISU("GeoportalVisuDiv", "normal", "GLP");
if (VISU) {
VISU.addGeoportalLayers([
'ORTHOIMAGERY.ORTHOPHOTOS:WMSC',
'GEOGRAPHICALGRIDSYSTEMS.MAPS:WMSC'
]);
}
VISU.getMap().setCenterAtLonLat(-0.263,47.24,12);
var url_wms = "http://cga.campus.wm.edu/ArcGIS/services/Watkinson/MapServer/WMSServer?";
VISU.getMap().addLayer("WMS", "DENEZE", url_wms, {
layers: '0',
transparent:'true',
format: 'image/png'
},
{
singleTile: true,
projection: 'EPSG:4326',
// units:'degrees',
// maxExtent expressed in EPSG:4326 :
maxExtent: new OpenLayers.Bounds(-0.29, 47.21, -0.24, 47.27),
minZoomLevel: 1,
maxZoomLevel: 20,
opacity: 0.9,
isBaseLayer: false,
visibility: true
});
VISU.addGeoportalLayers([
'CADASTRALPARCELS.PARCELS:WMSC',
'BUILDINGS.BUILDINGS:WMSC',
'ADMINISTRATIVEUNITS.BOUNDARIES:WMSC',
'HYDROGRAPHY.HYDROGRAPHY:WMSC'
]);
}
-->
</script>
<style type="text/css">
<!--
div#GeoportalVisuDiv {
width:720px;
height:540px;
}
-->
</style>
<div id="GeoportalVisuDiv"></div>
Partager