Radius

uspickle
01-07-2004, 03:22 PM
I have 800 push pins that I need to draw radii around. Is there a way to do it in one swoop? I tried importing an excel file with two columns: zip code and radius. When importing, I tried to use the radius value as the metropolitan area, but that did not produce the results I needed. Basically I need to map out locations and then highlight each location with a 60 mile radius so I can visually determine coverages in regions. Any help would be appreciated. Thanks.

Mossoft
01-12-2004, 09:55 AM
Call something like this after you have imported your data:

Sub DrawSplats(rds As MapPoint.DataSet, rdblRadius As Double)

Dim rs As MapPoint.Recordset
Dim shp As MapPoint.Shape

If rds.RecordCount > 0 Then
Set rs = rds.QueryAllRecords
rs.MoveFirst
Do
Set shp = rds.Parent.Parent.Shapes.AddShape(geoShapeRadius, rs.Pushpin.Location, rdblRadius*2, rdblRadius*2)

With shp
.Fill.ForeColor = vbRed
.Line.ForeColor = .Fill.ForeColor
.SizeVisible = False
.Fill.Visible = True
.ZOrder geoSendBehindRoads
End With
rs.MoveNext
Loop While Not rs.EOF
Set rs = Nothing
End If
End Sub


HTH

M.

uspickle
01-13-2004, 08:33 AM
Thank you very very much!

uspickle
01-13-2004, 08:51 AM
Unfortunately I could not find how to call the function. Where do I go to do this? Thanks.

uspickle
01-21-2004, 02:06 PM
hey I have all the code figured out except what to use as the first parameter in the function call.

I have map point open, the pushpins to encircle loaded onto the map, and have the code compiled
into a com add-in, which is added to map point via the [tools]==>[com add-in].

how do I reference the "MapPoint.DataSet" of the currently loaded map?

some code...


Call DrawSplats( <<<< first parameter >>>>>, 5)


my best guess for <<<< first parameter >>>>> is...

MapPoint.Application.ActiveMap.DataSets.AddPushpin Set("hello")

via

Dim objApp As New MapPoint.Application
objApp.ActiveMap.DataSets.AddPushpinSet("hello")

...

any suggestions?

plank
01-22-2004, 07:54 AM
Can anyone point me i the direction of where to use this code?? do i need MP2004??

I have been trying to do this for ages.... i am soon going to have to draw 119 radiuses on a map - PLEASE HELP!! :cry:

TIA

Dan

Mossoft
01-22-2004, 08:28 AM
After you have imported the data, in the legend there will probably be a representation of the dataset along with its name.
So, call the code using something like>

DrawSplats MapPoint.Application.ActiveMap.DataSets("<the dataset name as shown in the legend>"), 5

The default name is "My Pushpins" but your dataset may be called something completely different.

M.

plank
01-22-2004, 09:18 AM
please can you help me by telling me how to use this code?? is it VB?? or what is it??

Mossoft
01-23-2004, 02:58 AM
OK guys.

I have thrown together a COM Add-in which you can download from this site by clicking on this link http://www.mp2kmag.com/downloads/DrawSplats.zip

Zip file includes the code as well, so feel free to tweak. No guarantee implied or given!!

Good luck.

M.

plank
01-23-2004, 03:23 AM
You are an absolute star....... thank you ever so much - i hope it didnt take you too long. :D

uspickle
01-26-2004, 09:05 AM
Thanks a ton!

 
Web mp2kmag.com
mapforums.com