Calibrating a Map in Visio

Many years ago, I wrote a blog article about calibrating a map in Visio ( see https://blog.bvisual.net/2008/09/30/moving-between-visio-and-kml/ ), but I used VBA and a shape from my friend Chris Roth / VisGuy. Well, I have now worked out how to calibrate a map without code!

This could be especially useful now that MapPoint has been deprecated Smile

image

I have created a single LL Marker master shape that does all of the work for me.

The simple graphics provides a cross-hair to locate the shape accurately on top of a map.

image

As usual with Visio, the smartness is in the ShapeSheet, :

image

For clarity, the formulas are as follows:

Cell Formula
User.LLTrigger =IF(AND(NOT(Prop.Latitude=0),Prop.Position=1),SETF(GetRef(ThePage!User.LLPosition1Lat),Prop.Latitude)+SETF(GetRef(ThePage!User.LLPosition1Lon),Prop.Longitude)+SETF(GetRef(ThePage!User.LLPosition1X),PinX)+SETF(GetRef(ThePage!User.LLPosition1Y),PinY),IF(AND(NOT(Prop.Latitude=0),Prop.Position=2),SETF(GetRef(ThePage!User.LLPosition2Lat),Prop.Latitude)+SETF(GetRef(ThePage!User.LLPosition2Lon),Prop.Longitude)+SETF(GetRef(ThePage!User.LLPosition2X),PinX)+SETF(GetRef(ThePage!User.LLPosition2Y),PinY),0))
User.LLNameTrigger =IF(ISERRVALUE(OR(INT(INDEX(0,Prop.LLName,",")),INT(INDEX(1,Prop.LLName,",")))),0,IF(OR(NOT(Prop.Latitude=INDEX(0,Prop.LLName,",")),NOT(Prop.Longitude=INDEX(1,Prop.LLName,","))),SETF(GetRef(Prop.Latitude),INDEX(0,Prop.LLName,","))+SETF(GetRef(Prop.Longitude),INDEX(1,Prop.LLName,",")),0))
User.LLPositionTrigger =IF(AND(NOT(ThePage!User.LLPosition1Lon=ThePage!User.LLPosition2Lon),Prop.Position=0),SETF(GetRef(Prop.Longitude),ThePage!User.LLPosition1Lon+(((PinX-ThePage!User.LLPosition1X)/(ThePage!User.LLPosition1X-ThePage!User.LLPosition2X))*(ThePage!User.LLPosition1Lon-ThePage!User.LLPosition2Lon)))+SETF(GetRef(Prop.Latitude),ThePage!User.LLPosition1Lat+(((PinY-ThePage!User.LLPosition1Y)/(ThePage!User.LLPosition1Y-ThePage!User.LLPosition2Y))*(ThePage!User.LLPosition1Lat-ThePage!User.LLPosition2Lat)))+SETF(GetRef(Prop.LLName),"=Prop.Latitude&"",""&Prop.Longitude"),0)
Hyperlink.BingMaps.Address ="http://www.bing.com/maps/"
Hyperlink.BingMap.ExtraInfo ="lvl=11&sp=Point."&Prop.Latitude&"_"&Prop.Longitude&"_"&NAME()

This is all possible because of some User-defined cells were added to the page of the master:

image

When this master shaped is dropped on a page, then all of these User-defined cells will get copied to the page because they are referred to in the formulas of shape.

So, to calibrate the map (and indeed the whole Visio page), just two points are needed. Choose an easily recognisable feature on the map, such as a major road junction, and place an LL Marker shape.

image

Find the same feature in Bing Maps, right mouse click it to reveal the popup, and copy the Lat \ Lon text.

image

Paste the Lat / Lon text into the same named Shape Data row of the LL Marker shape in Visio, and change the Position to value = 1.

image

Then find another feature near the opposite corner of the map image, and copy its Lat / Lon text.

image

Paste the text again into a second LL Marker shape in the same position in Visio, and change the Position to 2.

image

Now, when any another LL Marker shapes are added, then they will automatically provide their Latitude and Longitude values

image

That is it. The whole Visio page is now calibrated to the map.

As proof, the LL Marker shape has a hyperlink to open Bing Maps ….

image

Bing Maps will be opened, and a marker dropped at the selected location:

image

Next time, I will use this calibrated map to drop data points in the correct locations automatically.

The example Visio 2013 document can be downloaded from http://1drv.ms/1Ky3DG6

And Visio 2010- format from : http://1drv.ms/1Axuwqv

4 Responses to “Calibrating a Map in Visio”

  1. Surrogate™ Says:

    Hi David !
    Can you add this example in not Visio2013 format? Thank you !


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

davecra.wordpress.com/

Microsoft Office Development, and more...

PowerShell.Amsterdam

Automate, Accelerate, Accurate

johnvisiomvp

Life with Visio and other Microsoft Toys!

Title (Required)

Windows Server Essentials Tips & Tricks

Nilsandrey's Weblog

Just another WordPress.com weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Shapes, Stencils, Drawings Templates, Tutorials, Tips & Developer Info for Microsoft Visio

Hannes's Virtual Earth

Tips & Tricks around Mapping and Cloud Computing

Pluralsight blog

be smart, be clear, be visual ...

%d bloggers like this: