Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all 2341 articles
Browse latest View live

New Post: Anyone used the MapWinGIS activeX in a ClickOnce deploy?

$
0
0
We've been exploring this as well. For MW5 we abandoned the click-once workflow because it gives more problems then it solves.
We've been experimenting with the manifest file and it will at least solves the need to register the ocx. Just copying will be enough.
In a short while we'll write a article about it how to do this for your own application.

Thanks,

Paul

New Post: Anyone used the MapWinGIS activeX in a ClickOnce deploy?

$
0
0
According to my testing a couple of months ago MapWinGIS can be installed in register free way, i.e. without regsvr32 / windows registry use. The simple steps listed here worked for me (basically all you need is to set Isolated property on PIA references). Of course you should also take care to deploy all the dependent libraries and GDAL data folder (coordinate systems). Our inno setup script can give an idea on what is needed. And Dependency Walker can help to deal with potential issues.

Hope it helps,
Sergei

New Post: Degree to projection conversion does not work second time.

$
0
0
Hi,

I am using mapwingis in a windows form C# application. When button control is calling the plot GIS map method it works. But when it is called second time the following line keep providing projX = 0.0 and projY = 0.0.

AxMap.DegreesToProj(Long, Lat, ref projX, ref projY);

New Post: how to write expression with vb.net in mapwingis (ShapefileCategory.Expression)

$
0
0
I would like to give color to the map with new category. to make must make previous expression. I've tried but still failed. What is wrong ? Please help me.
Dim category As MapWinGIS.ShapefileCategory = sf.Categories.Add("Manual")
Dim ad As String = "Alaska"
Dim UniqueShape As New MapWinGIS.Shapefile
UniqueShape = FormMain.AxMapMain.get_GetObject(idx)

Dim af As String = UniqueShape.Table.Field(1).Name
Const cote As String = """"

'failed
' category.Expression = "[STATE_NAME] = """ + ad + """"
'failed
' category.Expression = "[STATE_NAME] <> """""
'failed
category.Expression = "[" + af + "] = " + ad
'failed
category.Expression = "[STATE_NAME] = " & cote & "Alaska" & cote
'failed
'category.Expression = "[STATE_NAME] = ""Alaska"""

Dim utils As New MapWinGIS.Utils
category.DrawingOptions.FillColor = utils.ColorByName(MapWinGIS.tkMapColor.Magenta)
sf.Categories.ApplyExpression(0)

sf.DefaultDrawingOptions.Visible = False
' FormMain.AxMapMain.AddLayer(sf, True)
FormMain.AxMapMain.Redraw()
FormMain.AxMapMain.Refresh()

New Post: how to create new category with Expression

$
0
0
hi
i want to create a new symbol to create a new category. I've tried to create but fail, there is no map that changes color. please help me, I've been looking but have not found the solution

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    sf.Categories.Clear()
    idx = FormMain.Legend.SelectedLayer
    sf = FormMain.AxMapMain.get_Shapefile(idx)

    Dim cat As MapWinGIS.ShapefileCategory = sf.Categories.Add("1")
    cat.Expression = "[PERIMETER] >=0 AND [PERIMETER]<=2 "
    Dim utils As New MapWinGIS.Utils
    cat.DrawingOptions.FillColor = utils.ColorByName(MapWinGIS.tkMapColor.Magenta)

    sf.Categories.ApplyExpression(0)


    sf.DefaultDrawingOptions.Visible = False

    FormMain.AxMapMain.Redraw()
    FormMain.AxMapMain.Refresh()

End Sub

New Post: SnapShot3 crashing

$
0
0
Hey guys, I've been looking into a bug in my program and it looks like it's a map window bug.

My C# program is simply loading a 1GB geotiff into my map then splitting it up into 4000x4000 pixel tiles that are exported as bitmaps. I'm using SnapShot3 to do this.

The problem looks like it occurs at line 531 in ImageDrawing.cpp in a part of the code that is padding the image to be 4 byte alligned. Creating the new padded array throws an exception. At the time this happens my process (as per the task manager) is using ~800MBs of RAM and the new array trying to be allocated would be 300MBs. As I understand a regular 32bit process should be able to handle 2GBs at the least so I'm not sure what the problem is here. Am I hitting some memory limit I don't know about?

I could possibly tweak the size of the tile I'm requesting to make sure that the resulting image never needs to be padded but these seems like a round-a-bout way of fixing the problem. Kinda looks like this could also happen during a regular redraw on a zoom event because I can also get it to crash the same way by just setting the map extents to my lat/lon bounds instead of calling the snapshot function.

Any insight would be much appreciated! Thanks!

New Post: Change FillColor of single Shape

$
0
0
Hello everybody,

in my Project (win 8.1 64, MS-Access 2013 - 32, vba, MapWindow.ocx 4.9.3.5 Win32) I use the following code to find a shape and change the fillColor of it:
REM ...

' Layerobjekt erstellen
        Set objShape = Forms(strMap).mapMain.GetObject(lngHandle)
        ' Index erstellen
        intIndexField = objShape.Table.FieldIndexByName("oid")
        objShape.Categories.Generate intIndexField, MapWinGIS.tkClassificationType.ctUniqueValues, 0
        objShape.Categories.ApplyExpressions
        ' Shape-Objekte durchlaufen
        For i = 0 To objShape.NumShapes - 1
            ' auf GemarkungsNr testen
            If objShape.CellValue(1, i) = CStr(gmkgNr) Then
                ' Testen, ob FlurstücksNr übereinstimmt
                If objShape.CellValue(2, i) = CStr(flstNr) Then
                    ' Testen, ob Teilfläche übereinstimmt
                    If objShape.CellValue(3, i) = CStr(flstTl) Then
                        ' Auf Shape zoomen
                        Forms(strMap).mapMain.ZoomToShape lngHandle, i
                        ' Fenster vergößern - in Prozent
                        Forms(strMap).mapMain.zoomOut (3)
                        ' Farbe setzen
                        lngShpIndex = objShape.ShapeCategory(i) ' lngShpIndex = -1
                        ' Testen, ob Füllfarbe übergeben
                        If IsMissing(fillColor) Then
                            'objShape.Categories.Item(lngShpIndex).DrawingOptions.fillColor = ReadIni.getWert("SelectionColor")
                            objShape.Categories.Item(lngShpIndex).DrawingOptions.fillColor = 10584682
                        Else
                            objShape.Categories.Item(lngShpIndex).DrawingOptions.fillColor = fillColor
                        End If
                        ' Karte neu zeichnen - sonst wird beim ersten Aufruf das Flurstück nicht markiert
                        Forms(strMap).mapMain.Redraw
                    End If
                End If
            End If
        Next i

REM ...
The shape is found, as the inner if branch is entered, but lngShpIndex is set to -1 and accordingly the line:
objShape.Categories.Item(lngShpIndex).DrawingOptions.fillColor = 10584682
produces an "Object or withblock not set" error.

Can anybody see whats wrong?

Thanks and regards

New Post: Change FillColor of single Shape

$
0
0
Hello again,

I'm very sorry, that's so strange - I restarted Windows twice yesterday, with no change in behavior. So I gave up after a couple of hours and ran the machine down. Today I started the machine again and everything works well????!!!!

Created Unassigned: Google Hybrid Tiles [26008]

$
0
0
I am trying to use the Google Hybrid tiles in a VB .Net VS2013 application. I find there are areas that do not display the tiles, Open Streets and Google Maps seem to work fine. Using this code, half of the map displays the tiles and the other does not. Any input would be greatly appreciated.

Dim eExt As New MapWinGIS.Extents()

AxMap1.Projection = tkMapProjection.PROJECTION_GOOGLE_MERCATOR
AxMap1.TileProvider = tkTileProvider.GoogleHybrid

eExt.SetBounds(-10880183.78743764, 4108346.5470206295, 0, -10888802.062376793, 4101323.8950469294, 0)
AxMap1.Extents = eExt
AxMap1.CurrentScale = 30000
AxMap1.Refresh()

New Post: Tile Display Issue

$
0
0
I am trying to use the Google Hybrid tiles in a VB .Net VS2013 application. I find there are areas that do not display the tiles, Open Streets and Google Maps seem to work fine. Using this code, half of the map displays the tiles and the other does not. Any input would be greatly appreciated.

Dim eExt As New MapWinGIS.Extents()

AxMap1.Projection = tkMapProjection.PROJECTION_GOOGLE_MERCATOR
AxMap1.TileProvider = tkTileProvider.GoogleHybrid

eExt.SetBounds(-10880183.78743764, 4108346.5470206295, 0, -10888802.062376793, 4101323.8950469294, 0)
AxMap1.Extents = eExt
AxMap1.CurrentScale = 30000
AxMap1.Refresh()

New Post: Error 429

$
0
0

Hi All,

I have an access database that incorporates the MapWinGis (activex) component. I have this database installed on numerous systems. Two systems have some sort of problem that I’m having trouble debugging. It acts as if MapWinGis isn’t installed (cant create component errors), but if I go into the code library, references to MPGIS are there, below is a screen capture of the error message, and in the background you can see that access is ‘seeing’ mapwingis library. In this case, the offending line of code is:

GisLandfillFile.Open (GridFile)

Where GisLandfillFile is defined as:

GisLandfillFile As New MapWinGIS.Shapefile

I also get error messages if I open forms that include a map control object, with similar (no object in this control) errors. Any ideas?

Douglas J. KellyL.G., L.HG.

Hydrogeologist

Island County Environmental Health

(360) 678-7885

New Post: Shapefie.Categories.Generate crashes with large files

$
0
0
Hello everybody,

I use the following code in my MS-Access/Vba GIS application to clear a selection:
Public Sub clearSelection()
    ' Selection zurücksetzen
    
    Dim objShape As MapWinGIS.Shapefile
    Dim objOptions As MapWinGIS.ShapeDrawingOptions
    Dim lngLayerHandle As Long
    Dim varShapeIDs As Variant
    Dim lngShapeIndex As Long
    Dim i As Long
    
    ' get handle of active layer
    lngLayerHandle = colLayers(Me.lstProject.SelectedItem.Key).layerHandle
    ' create layerobject
    Set objShape = Me.mapMain.GetObject(lngLayerHandle)
    ' create index on the first column
    REM this line produces an out of stack space error with large files
    objShape.Categories.Generate 0, ctUniqueValues, 0
    ' get selected items
    objShape.SelectShapes Me.mapMain.Extents, 0, INTERSECTION, varShapeIDs
    objShape.Categories.ApplyExpressions
    ' iterate over selected items
    For i = 0 To UBound(varShapeIDs)
        ' get shapeindex of current item
        lngShapeIndex = objShape.ShapeCategory(varShapeIDs(i))
        ' reset fill color
        objShape.Categories.Item(lngShapeIndex).DrawingOptions.fillColor = _
            colLayers(Me.lstProject.SelectedItem.Key).fillColor
    Next i
    Me.mapMain.Redraw
End Sub
If the shapefile has a large number of Elements, in one case nearly 46,000 elements, the line:
objShape.Categories.Generate 0, ctUniqueValues, 0
leads to an error (28 - out of stack space).

I use index creation on several places in my code.

Is there a workaround?

Thanks and regards

New Post: Shapefie.Categories.Generate crashes with large files

$
0
0
Hello again,

I'm sorry, I forgot to mention its MapWinGis 4.9.3.5 Win32 on Windows 10, 8.1 and 7 (32 or 64 Bit) with Access 2013 32 Bit

Thanks again

New Post: Deploying application using Axmap and Shapefiles

$
0
0
Hello,

I made a little application that uses Axmap and Shapefiles. As reference i inserted the AxInterop.MapWinGIS.dll and the Interop.MapWinGIS.dll in my program in Visual Basic 2010.

All works fine, but now the question.

If i want to deploy my application on a other persons computer what do i need to do?

Do i copy and register those dll files? Do i use innosetup and if so how do i automaticly register those dll's?

I hope you guys can help me out.

New Post: Shapefie.Categories.Generate crashes with large files

$
0
0
Hello again,

I'm really sorry, it seems I fill up this thread on my own.

Work and studying the documentation brought me a Little further. So I found out that I don't Need to create an index to clear a selection. A simple
objShape.SelectNone
does the trick.

But still I'm stuck. Further down in my Code I iterate over the shapes of a shapefile and check certain Attributes. If an Attribute fits I'd like to add ths shape to a selection, or at least change the fillColor of it. The solution I found still uses an index. The Code is as follows:
' ...

' Create a shapefile object
Set objShape = Forms(strMap).mapMain.GetObject(lngHandle)

' Create the index
objShape.Categories.Generate 0, ctUniqueValues, 0
objShape.Categories.ApplyExpressions

' iterate over shapes
For i = 0 To objShape.NumShapes - 1
    ' Check for correct value
    If objShape.CellValue(1, i) = correctValue Then
        ' This is Where the Index seems to be needed
        lngShpIndex = objShape.ShapeCategory(i)
        ' Here I simply Change the fillColor
        objShape.Categories.Item(lngShpIndex).DrawingOptions.fillColor = Me.txtColor.BackColor
    End If
Next i
As stated before, the application crashes with very large Shapefiles. So here are two more questions:

1) Do I really Need to create the Index to Change the fillColor (up to 4.8.1 I could work with the the "i" value here)?
2) How can I add a shape to a selection?

Thanks again

Created Unassigned: set image.TransparencyColor2 cause error [26009]

$
0
0

Dear Sir,
I have updated mapwindow from v4.8 to v4.9, I got the following error when trying to run this line of code:

image.TransparencyColor2 = newColour;

//error message
Attempted to read or write protected memory. This is often an indication that other memory is corrupt

I am wondering if anyone has come across this error before?

thanks
Yong

New Post: Shapefie.Categories.Generate crashes with large files

$
0
0
Hello again,

I'm sorry to write again (let's call it my private thread), but after some experimentation I found out that if I build up the index by:
objShape.Categories.Generate intIndexField, ctNaturalBreaks, 0
The Code works.

So, still I'm not sure what objShape.Categories.Generate really does and what the difference between the Options really is. This link: http://www.mapwindow.org/documentation/mapwingis4.9/_enumerations_8cs.html#a44a53188d5016c1795c9c46578233f86 and this one: http://www.mapwindow.org/documentation/mapwingis4.9/class_shapefile_categories.html#ad9331a3944335049fed19886df1e5049 gave me not enough Information to get the idea behind (maybe due to my clumpsy English)

Thanks again

New Post: MapWinGis in LabVIEW

$
0
0
Hi,

I'm calling MapWinGis in LabVIEW, and trying to run a simple piece of code which drops point onto the map. I found an example in C#, and made the equivalent in LabVIEW. Now the code executes without any errors, however the ActiveX container acts oddly afterwards. From what I can see it freezes but will occasionally allow a zoom in and out, but it won't display the entire map. The projection is set to google mercator.

C# demo code :
http://www.mapwindow.org/documentation/mapwingis4.9/_create_point_shapefile_8cs-example.html

My question is this, has anyone been successful in creating a new shapefile programmatically through LabVIEW, and I've done extensive searching but was unable to find any LabVIEW examples, does anyone know a source that might help me figure out what I may be doing wrong?

Many Thanks,

Soloman

New Post: Deploying application using Axmap and Shapefiles

$
0
0
Wolfray99

I think you need to use some sort of installation package programme to build your installer.

There are several installation package programmes, e.g. visual stuido plugin, install shield, etc, some are free, some are paid.

You need to figure out what dll & files to include in your dll (probably everything in the MapwinGIS installer)

Regards to register dll, installation package programme can register mapwingis.oxc, or you can write a batch command to register after the install.

Hope this helps,
Yong

New Post: Deploying application using Axmap and Shapefiles

$
0
0
Hello,
     I use for Velsto INO setup which works fine and is also used for Mapwindow installers. Use the MapwinGis only installer (call it from your INO script) it saves you a lot of trouble.
Greetings Maurits
Viewing all 2341 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>