/ / Opanlayers Reprojection Kmlレイヤ - kml、openlayers、地図投影法

オペラ層再投影Kml層 - kml、openlayers、地図投影

ベースマップには "EPSG:32639"投影図、kmlレイヤには "EPSG:4326"投影図があります。それは単に私のベースマップを表示し、kmlレイヤを表示しません。それのどこが悪いんだい?

私のソースコードはtherです。

function initMap(){
// if this is just a coverage or a group of them, disable a few items,
// and default to jpeg format
format = "image/png";

var bounds = new OpenLayers.Bounds(
551438.385, 3602649.973,
571430.791, 3627258.571
);
var options = {
controls: [
new OpenLayers.Control.Navigation( {mouseWheelOptions: {interval: 100}}),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.NavToolbar(),
new OpenLayers.Control.LayerSwitcher({"ascending":false}),
new OpenLayers.Control.Permalink(),
new OpenLayers.Control.ScaleLine(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.Scale($("scale")),
new OpenLayers.Control.OverviewMap(),
new OpenLayers.Control.KeyboardDefaults(),
new OpenLayers.Control.ZoomBox({alwaysZoom:true})
],
maxExtent: bounds,
projection: "EPSG:32639",
units: "m",
maxResolution: 136.21203906250003,
numZoomLevels: 10,
};
map = new OpenLayers.Map("map", options);


tiled = new OpenLayers.Layer.TileCache("ESFAHANMAP",
["http://www.memap.ir/map"],"ESFAHANMAP",{"format":"image/jpeg",sphericalMercator: true, buffer: 0 });


kmlLayer = new OpenLayers.Layer.Vector("Points", "point.kml",{
projection: new OpenLayers.Projection("EPSG:4326")
});
map.addLayers([tiled,kmlLayer]);
map.zoomToExtent(bounds);

}

回答:

回答№1は0

同じマップ上に異なる投影法を表示することはできません。KMLの機能を、ベースマップと同じ投影法に再投影する必要があります。例を参照してください。 ここに