简体   繁体   English

如何将OpenLayers与MapGuide源码一起使用

[英]How to use OpenLayers with MapGuide source

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&"; 基本上,我希望下面的示例http://openlayers.org/dev/examples/mapguide.html针对此WMS数据源“ 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. 我找到了以下在线文档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"
        };

How do I get the correct values for the above parameters? 如何获得上述参数的正确值?

You should be able to get information about WMS from GetCapabilities request that in your case should look like this: 您应该能够从GetCapabilities请求中获取有关WMS的信息,您的情况应如下所示:

http://gis.aarhus.dk/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1 http://gis.aarhus.dk/mapguide/mapagent/mapagent.fcgi?USERNAME=Anonymous&REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM