如何将 OpenLayers 与 MapGuide 源一起使用
到目前为止我所做的只是更改网址。
var url = "http://gis.aarhus.dk/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&";
我找到了以下在线文档 http://dev.openlayers.org /docs/files/OpenLayers/Layer/MapGuide-js.html 但我不知道从哪里获取这些参数的正确值。
var metersPerUnit = 111319.4908; //value returned from mapguide
var inPerUnit = OpenLayers.INCHES_PER_UNIT.m * metersPerUnit;
OpenLayers.INCHES_PER_UNIT["dd"] = inPerUnit;
OpenLayers.INCHES_PER_UNIT["degrees"] = inPerUnit;
OpenLayers.DOTS_PER_INCH = 96;
var extent = new OpenLayers.Bounds(-87.764987, 43.691398, -87.695522, 43.797520);
var tempScales = [100000, 51794.74679, 26826.95795, 13894.95494, 7196.85673, 3727.59372, 1930.69773, 1000];
var params = {
mapdefinition: 'Library://Samples/Sheboygan/MapsTiled/Sheboygan.MapDefinition',
basemaplayergroupname: "Base Layer Group"
};
如何获得上述参数的正确值?
Basically I want the following example http://openlayers.org/dev/examples/mapguide.html to worj against this WMS datasource "http://gis.aarhus.dk/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&";
All I have done so far is changing the url.
var url = "http://gis.aarhus.dk/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&";
I found the following online docs http://dev.openlayers.org/docs/files/OpenLayers/Layer/MapGuide-js.html but I dont know where to get the correct values for these parameters.
var metersPerUnit = 111319.4908; //value returned from mapguide
var inPerUnit = OpenLayers.INCHES_PER_UNIT.m * metersPerUnit;
OpenLayers.INCHES_PER_UNIT["dd"] = inPerUnit;
OpenLayers.INCHES_PER_UNIT["degrees"] = inPerUnit;
OpenLayers.DOTS_PER_INCH = 96;
var extent = new OpenLayers.Bounds(-87.764987, 43.691398, -87.695522, 43.797520);
var tempScales = [100000, 51794.74679, 26826.95795, 13894.95494, 7196.85673, 3727.59372, 1930.69773, 1000];
var params = {
mapdefinition: 'Library://Samples/Sheboygan/MapsTiled/Sheboygan.MapDefinition',
basemaplayergroupname: "Base Layer Group"
};
How do I get the correct values for the above parameters?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够从 GetCapability 请求获取有关 WMS 的信息,在您的情况下,该请求应如下所示:
http://gis.aarhus.dk/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&REQUEST=GetCapability&SERVICE=WMS&VERSION=1.1.1
You should be able to get information about WMS from GetCapabilities request that in your case should look like this:
http://gis.aarhus.dk/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1