Hello everyone!

-         A have tow layers “binhdo” and “chisongap”.

-         Layer “Chisongap” :

+ bbox: [108.778030395508, 11.5106945037842,

109.076278686523, 11.7382249832153];

+ Paramas: point

          + Unit: ‘degress’

          + Style: “chisongap”

-         Layer “binhdo” :

+ bbox: [907404.4493628424,1272440.438440118,

951921.6600264888, 1300968.47164172];

+ Paramas: polyline

          + Unit: ‘m’

          + Style : null

I want dislay tow layers on one page. I write code:



<html xmlns="http://www.w3.org/1999/xhtml";>

<head runat="server">

<meta http-equiv="content-type" content="text/html;charset=utf-8" />

<title>Binh do</title>

<link rel="stylesheet" href="Openlayeslibrary/ol.css" type="text/css">

<script src="Openlayeslibrary/ol.js" type="text/javascript"></script>

<script src="Openlayeslibrary/jquery.min.js"
type="text/javascript"></script>

<style>

.map {

height: 100%;

width: 100%;

}

</style>

<script type="text/javascript">

$("#document").ready(function () {

var format = 'image/png';

var bounds = [108.778030395508, 11.5106945037842,

109.076278686523, 11.7382249832153];

var bounds1 = [907404.4493628424,1272440.438440118,

951921.6600264888, 1300968.47164172];

var chisongap = new ol.layer.Image({

source: new ol.source.ImageWMS({

ratio: 1,

url: 'http://localhost:8080/geoserver/chisongap/wms',

params: {

'FORMAT': format,

'VERSION': '1.1.1',

STYLES: 'chisongap',

LAYERS: 'chisongap:chisongap_point',

}

})

});

var binhdo = new ol.layer.Image({

source: new ol.source.ImageWMS({

ratio: 1,

url: 'http://localhost:8080/geoserver/binhdo/wms',

params: {

'FORMAT': format,

'VERSION': '1.1.1',

STYLES: '',

LAYERS: 'binhdo:binhdo_polyline',

}

})

});

var projection = new ol.proj.Projection({

code: 'EPSG:3405',

units: 'degress',

axisOrientation: 'neu'

});

var projection1 = new ol.proj.Projection({

code: 'EPSG:3405',

units: 'm',

axisOrientation: 'neu'

});

var map = new ol.Map({

target: 'map',

layers: [

chisongap, binhdo

],

view: new ol.View({

projection: projection, projection1

})

});

//map.getView().fitExtent(bounds, map.getSize());

map.getView().fit((bounds, map.getSize()),(bounds1, map.getSize()) );

});

</script>

</head>

<body>

<div id="map" class="map"></div

</body>

</html>

It not working. Could anyone please correct this.



Thank you and best regards!

Xuan Bao Nguyen.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to