使用产品:iserver 9.1.0
地图源:iserver发布的国家2000天地图矢量图
js代码如下:
var map,
url = "http://192.168.0.121:8090/iserver/services/map-GIS_WS/rest/maps/TianDiTu_CGCS2000_VEC";
proj4.defs("EPSG:4490","+proj=longlat +ellps=GRS80 +no_defs");
var projection4490 = new ol.proj.get('EPSG:4490');
projection4490.setExtent([-180,-90,180,90]);
map = new ol.Map({
target: 'map',
controls: ol.control.defaults({attributionOptions: {collapsed: false}})
.extend([new ol.supermap.control.Logo()]),
view: new ol.View({
center: [112.39635990831,25.6034897345281],
zoom:2,
projection:projection4490
})
});
var layer = new ol.layer.Tile({
source: new ol.source.TileSuperMapRest({
url: url,
wrapX: true
}),
projection:projection4490
});
map.addLayer(layer);
运行结果: