How to use OpenLayers with MapGuide source

心不动则不痛 提交于 2019-12-08 07:34:11

问题


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?


回答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



来源:https://stackoverflow.com/questions/6922099/how-to-use-openlayers-with-mapguide-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!