マップの投影を元にもどします。
それから、WEB オブジェクトの METADATA と railroad と public_facilities レイヤ(LAYER)の METADATA を次のようにします。
MAP
NAME kanagawa_mlit_pgis_map
STATUS ON
SIZE 600 300
# EXTENT 138.91 35.12 139.84 35.68
EXTENT -83624.557161 -96269.254733 -3366.679476 -36305.074927
UNITS dd
IMAGECOLOR 255 255 255
IMAGETYPE png
FONTSET "fonts.txt"
PROJECTION
"init=epsg:4612"
END
WEB
IMAGEPATH "/home/user/ka-map/htdocs/tmp/kacache/"
IMAGEURL "/ka-map/tmp/kacache/"
METADATA
"wms_title" "Kamakura mlit Map WMS Server"
"wms_srs" "EPSG:2451 EPSG:4612" #修正
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/home/user/mapfile/kanagawa_mlit_pgis.map"
"wms_encoding" "utf-8"
"wms_feature_info_mime_type" "text/html"
"wfs_title" "Kamakura mlit Map WFS Server"
"wfs_srs" "EPSG:2451 EPSG:4612" #修正
END
END
---
LAYER
NAME railroad
---
METADATA
"group_title" "鉄道"
"wms_title" "Railroad Map WMS Layer"
"wms_srs" "EPSG:4612" #追加
"wfs_title" "Railroad Map WFS Layer"
"searchfield" "lin"
"fields" "lin:鉄道,opc:会社"
END
---
LAYER
NAME public_facilities
---
METADATA
"group_title" "公共施設"
"wms_title" "Public Facilities Kanagawa mlit WMS Layer"
"wms_srs" "EPSG:4612" #追加
"wfs_title" "Public Facilities Kanagawa mlit WFS Layer"
"gml_featureid" "place_id"
"gml_include_items" "all"
"gml_exclude_items" ""
"searchfield" "na0"
"fields" "na0:公共施設,ads:住所"
END
---
Eclipse を起動して wms_meters.html を開き、次のように layer3 を追加します。
---
<script type="text/javascript">
var map, layer1, layer2, layre3;
---
layer3 = new OpenLayers.Layer.WMS( "RailRoad mlit WMS",
"http://localhost/cgi-bin/mapserv?",
{
map: '/home/user/mapfile/kanagawa_mlit_pgis.map',
layers: 'railroad',
transparent: true,
format: 'image/png'
},
{
projection: 'EPSG:4612'
}
);
map.addLayer(layer3);
map.addLayers([layer1, layer2]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.zoomToMaxExtent();
}
</script>
---
0 件のコメント:
コメントを投稿