Openlayers 3 を使用して 2 つのレイヤーを表示しようとしています。1 つはグリーンランドの地図で、もう 1 つは対象地域です。両方のレイヤーがタイル化されています。
動作しているようですが、透明なタイルしか得られないので、どういうわけか何もない場所にビューを配置しています。UTM 24 N プロジェクションを使用しています (これは、関連するレイヤーの元のプロジェクションであるため、変換は必要ありません)。
これが私のコードです:
var utm24_projection = new ol.proj.Projection({
code: 'EPSG:32624',
extent: [-396882, 6394710, 1280839.6, 9750153.2],
units: 'm',
axisOrientation: 'neu'
});
ol.proj.addProjection(utm24_projection);
layer1 = new ol.layer.Tile({
source: new ol.source.TileWMS({
url: 'http://www.ourmapserver.gl/geoserver/wms',
params: {'LAYERS': 'ourcompany:greenland', 'TILED': true},
serverType: 'geoserver',
})
});
layer2 = new ol.layer.Tile({
//extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.TileWMS({
url: 'http://www.ourmapserver.gl/geoserver/wms',
params: {'LAYERS': 'ourcompany:interestarea', 'TILED': true},
//projection = ol.proj.get('EPSG:32624');
serverType: 'geoserver'
})
});
var layers = [
layer1,
layer2
];
var map = new ol.Map({
layers: layers,
target: 'map',
view: new ol.View({
projection: utm24_projection,
center: [-48864, 7491452],
zoom: 4
})
});
Web メルカトルを使用すると問題なく動作しました。