Many years ago, I wrote a blog article about calibrating a map in Visio ( see http://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
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.
As usual with Visio, the smartness is in the ShapeSheet, :
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:
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.
Find the same feature in Bing Maps, right mouse click it to reveal the popup, and copy the Lat \ Lon text.
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.
Then find another feature near the opposite corner of the map image, and copy its Lat / Lon text.
Paste the text again into a second LL Marker shape in the same position in Visio, and change the Position to 2.
Now, when any another LL Marker shapes are added, then they will automatically provide their Latitude and Longitude values
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 ….
Bing Maps will be opened, and a marker dropped at the selected location:
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 LL Marker Example.vsdx
And Visio 2010- format from : LL Marker Example.vsd