MapServer настроил на WMS, (сразу оговорюсь ОС windows 10), "проверку" проходит:
Код: Выделить всё
http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities
Спойлер
Код: Выделить всё
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd"
[
<!ELEMENT VendorSpecificCapabilities EMPTY>
]> <!-- end of DOCTYPE declaration -->
<WMT_MS_Capabilities version="1.1.1">
<!-- MapServer version 7.0.1 (MS4W 3.1.3) OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE -->
<Service>
<Name>OGC:WMS</Name>
<Title>GIS-LAB Demo</Title>
<Abstract>This is the WMS demo from GIS-Lab</Abstract>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/>
<ContactInformation>
</ContactInformation>
</Service>
<Capability>
<Request>
<GetCapabilities>
<Format>application/vnd.ogc.wms_xml</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Post>
</HTTP>
</DCPType>
</GetCapabilities>
<GetMap>
<Format>image/png</Format>
<Format>image/jpeg</Format>
<Format>image/png; mode=8bit</Format>
<Format>application/x-pdf</Format>
<Format>image/svg+xml</Format>
<Format>image/tiff</Format>
<Format>application/vnd.google-earth.kml+xml</Format>
<Format>application/vnd.google-earth.kmz</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Post>
</HTTP>
</DCPType>
</GetMap>
<GetFeatureInfo>
<Format>text/plain</Format>
<Format>application/vnd.ogc.gml</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Post>
</HTTP>
</DCPType>
</GetFeatureInfo>
<DescribeLayer>
<Format>text/xml</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Post>
</HTTP>
</DCPType>
</DescribeLayer>
<GetLegendGraphic>
<Format>image/png</Format>
<Format>image/jpeg</Format>
<Format>image/png; mode=8bit</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Post>
</HTTP>
</DCPType>
</GetLegendGraphic>
<GetStyles>
<Format>text/xml</Format>
<DCPType>
<HTTP>
<Get><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Get>
<Post><OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&"/></Post>
</HTTP>
</DCPType>
</GetStyles>
</Request>
<Exception>
<Format>application/vnd.ogc.se_xml</Format>
<Format>application/vnd.ogc.se_inimage</Format>
<Format>application/vnd.ogc.se_blank</Format>
</Exception>
<VendorSpecificCapabilities />
<UserDefinedSymbolization SupportSLD="1" UserLayer="0" UserStyle="1" RemoteWFS="0"/>
<Layer>
<Name>WMS</Name>
<Title>GIS-LAB Demo</Title>
<Abstract>This is the WMS demo from GIS-Lab</Abstract>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-11.705" miny="1468.97" maxx="363.771" maxy="1968.27" />
<Layer queryable="0" opaque="0" cascaded="0">
<Name>veget</Name>
<Title>Countries 1</Title>
<Abstract>Countries 1 test</Abstract>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="37.2273" miny="1515.79" maxx="245.538" maxy="1874.86" />
<BoundingBox SRS="EPSG:4326"
minx="37.2273" miny="1515.79" maxx="245.538" maxy="1874.86" />
<Style>
<Name>default</Name>
<Title>default</Title>
<LegendURL width="84" height="43">
<Format>image/png</Format>
<OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="simple" xlink:href="http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=veget&format=image/png&STYLE=default"/>
</LegendURL>
</Style>
</Layer>
<Layer queryable="0" opaque="0" cascaded="0">
<Name>mappers</Name>
<Title>Countries 2</Title>
<Abstract>Countries 2 test</Abstract>
<SRS>EPSG:4326</SRS>
<LatLonBoundingBox minx="-11.7368" miny="1469" maxx="363.739" maxy="1968.3" />
<BoundingBox SRS="EPSG:4326"
minx="-11.7368" miny="1469" maxx="363.739" maxy="1968.3" />
</Layer>
</Layer>
</Capability>
</WMT_MS_Capabilities>
Код: Выделить всё
http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&
В Leaflet ничего не отображает ни при помощи стандартных инструментов:
Спойлер
Код: Выделить всё
var wmsLayer = L.tileLayer.wms('http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&', {
layers: 'veget,mappers'
}).addTo(map);
Ни при помощи плагина leaflet.wms.js:
Спойлер
Код: Выделить всё
var map = L.map('map', {
minZoom: 1,
maxZoom: 5
}).setView([1468.9700,-11.7050], 1);
map.setMaxBounds(new L.LatLngBounds([1468.9700,-11.7050], [1968.2705,363.7705]));
var source = L.WMS.source("http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/example/polt.map&", {
'transparent': true,
'tiled': true
});
source.getLayer("veget").addTo(map);
source.getLayer("mappers").addTo(map);