如何将 OpenLayers 与 MapGuide 源一起使用

发布于 2024-11-27 18:29:21 字数 1314 浏览 2 评论 0原文

基本上我想要以下示例 http://openlayers.org/dev/examples/mapguide.html 针对此 WMS 数据源“http://gis.aarhus.dk/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&”进行工作;

到目前为止我所做的只是更改网址。

   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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

☆獨立☆ 2024-12-04 18:29:21

您应该能够从 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文