WMS add layer

Jan 5, 2016 at 2:11 AM
Hi i'm trying to load a wms layer to the new mapwingis but i can't make it work.

what i'm doing right now is the following
MapWinGIS.WmsLayer test = new MapWinGIS.WmsLayer();
        test.BaseUrl = "http://127.0.0.1:8080/geoserver/wms?";
        test.Epsg = 4326;
        test.Layers="usa:states";
        test.Format = "image/png";
        test.DoCaching = true;
       int a= axMap1.AddLayer(test, true);
hope you can help me
Jan 7, 2016 at 2:20 PM
I would love to see some sample code (ideally in VB) for loading WMS layers. The following address will work in QGIS but I had no success with MapWin

http://maps.vcgi.org/arcgis/services/EGC_services/MAP_VCGI_USTOPO_SP_CACHE/ImageServer/WMSServer

I am using VB2010 Express and MapWinGIS 4.9.3.6

I'm not even sure where to look for documentation on WMS layers - a new feature from 4.9.3.5. I'm really looking forward to this great new addition, Thanks in advance.
Coordinator
Jan 21, 2016 at 2:08 PM
Here is some documentation about the WMS class:
http://www.mapwindow.org/documentation/mapwingis4.9/class_wms_layer.html

I just tested your url in MW5 and it cannot connect either.
I've created an issue about this: https://mapwindow.atlassian.net/browse/MWGIS-28

Thanks,

Paul
Jan 31, 2016 at 1:24 AM
Hi i´ve been trying to load a layer from the wms example server from the documentation. I´m able to load it on quantum gis but not in mapwingis.
The problem if not loading a wms layer is for all the wms servers?.
The code i´m using is275:

WmsLayerClass myLayer = new WmsLayerClass();
        myLayer.BaseUrl = "http://demo.lizardtech.com/lizardtech/iserv/ows";
        myLayer.Layers = "MODIS";
        myLayer.Epsg = 4326;
        myLayer.Styles = "";
        myLayer.Format = "png";
        myLayer.Version = tkWmsVersion.wv111;
        int a=axMap1.AddLayer(myLayer, true);
        axMap1.ZoomToTileLevel(0);
        axMap1.Redraw();
Apr 19, 2016 at 4:03 PM
Edited Apr 20, 2016 at 2:17 PM
Hi i've been trying to load a layer from wms server, working on excel with MapWinGis 4.9.4,
after run the code the wmslayer is not empty but I can not see it on the map

wmshp.BaseUrl = "http://www.juntadeandalucia.es/institutodeestadisticaycartografia/geoserver-ieca/grid/wms?"
wmshp.Epsg = 4258
wmshp.Version = wv13
wmshp.Format = "image/png"
wmshp.Layers = "poblacion_total"
wmshp.DoCaching = True
success = wmshp.IsEmpty
a = Sheets("MAPA").axMap1.AddLayer(wmshp, True)

I've instaled Mapwindows, after uninstall the ActiveX MapWinGis, and I can load in a project, without problems, the layer of this server, with the plugin "Online data", but if I reinstall the ActiveX MapWinGis this plugin d'nt work and show this
message:

20/04/2016 16:11:18
System.AccessViolationException:
Intento de leer o escribir en la memoria protegida.
*A menudo, esto indica que hay otra memoria dañada.
  • en MapWinGIS.GridHeaderClass.get_GeoProjection()
  • en MapWindow.Controls.LayerSource.get_Projection()
  • en MapWindow.Controls.Projections.MismatchTester.TestLayer(LayerSource layer, LayerSource& newLayer) en MapWindow.Controls.Projections.MismatchTester.TestLayer(String filename, String& newName)
  • en MapWindow.Layers.AddLayerFromFilename(String[] filenames, String LayerName, Int32 Group, Boolean LayerVisible, GridColorScheme GrdColorScheme, Boolean LegendVisible, Boolean PositionFromSelected, Int32 LayerPosition, Boolean LoadXMLInfo, GeoProjection& geoProjection)
  • en MapWindow.Layers.AddLayer(Object ObjectOrFilename, String LayerName, Int32 Group, Boolean LayerVisible, Int32 Color, Int32 OutlineColor, Boolean DrawFill, Single LineOrPointSize, tkPointType PointType, GridColorScheme GrdColorScheme, Boolean LegendVisible, Boolean PositionFromSelected, Int32 LayerPosition, Boolean LoadXMLInfo, GeoProjection& geoProjection)
  • en MapWindow.Layers.Add(String Filename, String LayerName)
  • en OnlineDataPlugin.frmOnlineDataStatus.DataUpdateReady(clsLoadedItem FetchingForItem)
Thanks