Ich hoffe, die Antwort darauf ist ziemlich einfach und ich habe einfach etwas Einfaches fehl am Platz.OpenLayers vs. OpenLayers 3 Hinzufügen von MapServer Layern
In Openlayers 1 Ich füge eine Schicht so ...
msSection = new OpenLayers.Layer.MapServer("Section",
MSBaseURL+"/MappingSection.map&",
{ layers: 'section', exceptions: "application/vnd.ogc.se_xml" },
{ isBaseLayer: false, opacity: 0.9 },
{ tileSize: new OpenLayers.Size(256, 256), buffer: 1 });
msSection.setVisibility(false);
die Map-Datei wie folgt aussieht ...
MAP
IMAGETYPE PNG24
CONFIG "PROJ_LIB" "C:/Program Files/MapServer/projlib/"
SIZE 256 256
FONTSET "D:/RCIS/Web/MapServerDlls/content/fontset.txt"
IMAGECOLOR 255 255 255
TRANSPARENT ON
PROJECTION
"init=epsg:4326"
END
LAYER
NAME "section"
TYPE POLYGON
STATUS ON
LABELCACHE ON
PROCESSING 'LABEL_NO_CLIP=1'
CONNECTIONTYPE PLUGIN
PLUGIN "msplugin_mssql2008.dll"
MAXGEOWIDTH .08
CONNECTION "server=someserver,someport;uid=someuser;pwd=somepassword;Initial Catalog=NATIONALDB;Integrated Security=False"
DATA "shape(geography),SECTION from NATIONALDB.sde.SECTION USING INDEX SECTION_SIDX USING UNIQUE SECTION_ID USING SRID=4269"
LABELITEM "SECTION"
CLASS
STYLE
OUTLINECOLOR 255 000 000
WIDTH 3
END
LABEL
COLOR 255 000 000
TYPE TRUETYPE
FONT Arial
SIZE 12
ANTIALIAS TRUE
POSITION CL
PARTIALS FALSE
#MINDISTANCE 300
#BUFFER 15
END
END
PROJECTION
"init=epsg:4326"
END
END
END
... und alles ist glücklich und arbeitet .. . ich versuche, das 3 ... in Openlayers
var Section = new ol.layer.Tile({
name: 'Section',
source: new ol.source.TileWMS({
url: 'http://localhost:8080/cgi-bin/mapserv.exe?map=D:/RCIS/Web/Mapfiles/MappingSection.map&',
params: { 'LAYERS': 'section' },
serverType: 'mapserver'
})
});
control.map.addLayer(Section);
... und es zeigt, Code 200 OK in Chrom Entwickler-Tools, aber doe hinzufügen s nicht funktioniert, wenn ich eine der Kacheln in die Adressleiste wieder habe ich diesen Fehler ..
<ServiceException>
msWMSDispatch(): WMS server error. WMS request not enabled. Check wms/ows_enable_request settings.
</ServiceException>
Ich bin von dieser völlig verwirrt, ist jede Hilfe sehr dankbar !!
Vielen Dank !! Ich habe das schon zu lange bekämpft !! –