Converting v4.7 to v4.8 (Access 2007 VBA)

Nov 27, 2011 at 7:14 PM
Edited Dec 16, 2011 at 1:10 PM

Using this discussion for notes on issues I've encountered going from v4.7 to v 4.8.

Perhaps others can add to the same discussion if other issues are encountered, so that everything is in one place?

My map control is in Access 2007, VBA code.

1. Map control has to be re-done as a completely new control, after 4.8 is installed. 

2. Redraws that were 'automatic' now sometimes need a) some action to put focus on the map before redraw is done or b) mapObj.Redraw. Safest with .Redraw so putting that in everywhere.
E.g. ShapeLayerFillColor, ShapeLayerLineColor, ShapeLayerPointSize, etc. Some still redraw without .Redraw e.g. ShapeLayerLineWidth.

3. ShapeLayerPointType - can't get it to change point type as before. MapWinGIS.tkPointType still exists, ptSquare, ptCircle, etc still defined. Can't figure out what syntax has changed or other reason it doesn't work e.g.:
mapObj.ShapeLayerPointType(intHnd) =  ptSquare. 
Searching in the code (\Control\Map_Shapefile.cpp) I find:
00017: // TODO: the following propoerties for the new symbology must be implemented
00018: // ShapeLayerLineStipple
00019: // ShapeLayerFillStipple
00020: // ShapeLayerPointType 
Does this TODO mean these are not implemented in 4.8 at this time? 

Dec 1, 2011 at 8:54 PM

I'm also upgrading my Access 2007 project with the map control from v4.7 to v4.8 and all use of ShapeFillColor or ApplyLegendColors no longer function, so I'm unable to get different colours to display for shapes in a shapefile depending on attribute values.

Has anyone else come across this and is there a fix?

Dec 13, 2011 at 11:25 AM

4. Shapefile object, needs sf.Open after Set sf = New MapWinGIS.Shapefile, and before sf.StartEditingShapes, sf.StartEditingTable, where it apparently wasn't necessary in 4.7

Dec 13, 2011 at 7:43 PM
Edited Dec 16, 2011 at 1:04 PM


Dec 23, 2011 at 9:35 AM

5. The behaviour of sf.SelectShapes appears to be different. In any case, my code to capture the result of SelectShapes to [result], initiated as a Variant, no longer works as before.
I am using this with <mapControl>_MouseUp and <mapControl>_SelectBoxFinal to get selected shapes for an Info pop-up.
I was testing UBound(SelectShapesResult) to make sure I had selected shapes, but the Ubound of the result is now always 0, no matter what tolerance.
Worked before, doesn't now. 

Dec 23, 2011 at 3:16 PM
Edited Dec 27, 2011 at 6:45 PM

6.  Map.DrawCircle(x, y, pixelRadius, Color, fill)    - pixelRadius values that were chosen for 4.7, now in 4.8 create huge circles by a factor of maybe 100. Also, without any other function calls, the circles in 4.7 would remain in size during zoom in and zoom out. In 4.8, the circles scale with the map

** UPDATE ** It is NOT the DrawCircle() function that is problem, it is the NewDrawing() function.

  In 4.8, the NewDrawing() function is not creating a new drawing layer and not returning a valid handle to a new layer. The function does seem to increment the handle number, starting from 0 each time it is called, but subsequent calls like DrawCircle() that should be drawing on the "new" layer simply draw on Layer 0.