VBA Support
All Geodesix functions can be called and the UI completely customised from VBA. A sample spreadsheet is supplied, view it with Help->VBA.
To enable these functions:
- Open Excel
- Open the VBA editor
- Insert a new Module
- Paste this file into the module source
- Save the module and rename it “Geodesix_” (notice the trailing underscore).
You can now use these functions:
Name | Type | Description | Arguments | VBA Sample |
---|---|---|---|---|
addressbar | Function | Displays the address bar | true or false | Position cmbPosition.value |
clicked | Function | Returns the coordinates where the user last clicked on the map (that is displayed in the ‘Find’ field in the toolbar). Returns 0 if never clicked | MsgBox Clicked | |
default | Method | Restores the default map | Default | |
drawcircle | Method | Draws a circle on the map | id, lat, lng, radius, text, strokecolour, strokeopacity, strokeweight, fillcolour, fillopacity | DrawCircle 1, 48.868916, 2.37793, 100000, “Paris”, “navy”, 1, 2, “yellow”, 0.5 |
drawdirections | Method | Draws directions on the map. The first point is the origin, the last point is the destination and all the others are mandatory waypoints | id, points, mode, strokecolour, strokeopacity, strokeweight, suppressInfoWindows, suppressMarkers | DrawDirections 2, points, “driving”, “blue”, 1, 3, False, False |
drawinfowindow | Method | Draws an infowindow on the map | id, lat, lng, content | DrawInfoWindow 3, 48.33099, 4.635069, “near Troyes” |
drawkml | Method | Draws a KML outline on the map | id, kmlurl, text, strokecolour, strokeopacity, strokeweight, fillcolour, fillopacity | DrawKML 8, “Switzerland”, “CH”, “red”, 0.5, 3, “white”, 0.4 |
drawlegend | Method | Draws a legend | id, URI, location | DrawLegend 27, “http://www.calvert.ch/download/legend.htm”, “right_bottom” |
drawline | Method | Draws a line on the map | id, lat1, lon1, lat2, lon2, text, strokecolour, strokeopacity, strokeweight | DrawLine 4, 45.825284, 1.273252, 46.19155, 6.129209, “Dijon-Geneva”, “fuchsia”, 0.8, 6 |
drawmarker | Method | Creates an icon on the map. The title appears when hovering over the icon. Clicking the icon displays the HTML, formatted | id, latitude, longitude, icon, title, html | DrawMarker 5, 47.313063, 5.041563, “http://www.calvert.ch/images/mapicons/bigcity.png”, “Dijon Castle” |
drawpolygon | Method | Draws a polygon on the map | DrawPolygon 6, points, “Good wine here!”, “red”, 1, 3, “green”, 0.3 | DrawPolygon 6, points, “Good wine here!”, “red”, 1, 3, “green”, 0.3 |
drawpolyline | Method | Draws a Polyline on the map | DrawPolyLine 7, points, “ZigZag”, “aqua”, 0.8, 4 | |
help | Function | Displays the help page over the map. Returns Whether the page is currently being displayed | None | Help CBool(cmbHelp.value) |
language | Function | Sets the map’s language. Returns the current language | Language code as listed at http://code.google.com/apis/maps/faq.html#languagesupport | Language cmbLanguage.value |
navigate | Method | Displays a webpage instead of a map. Use ‘default’ to go back to the map page | A URL | Navigate “http://www.google.ch/?hl=en” |
position | Function | Docks the map pane. Returns where it is currently docked | Top, Bottom, Left, Right | Position cmbPosition.value |
regionbias | Function | Sets the map’s region bias Returns the current region bias. See http://code.google.com/apis/maps/documentation/geocoding/#RegionCodes | Language code as listed at http://code.google.com/apis/maps/faq.html#languagesupport | RegionBias cmbRegion.value |
showing | Function | Displays what type of page the map pane is currently displaying: geocoder, filght, route or url | MsgBox Showing | |
showlocation | Method | Displays a place, with appropriate zooming | The name of a place | ShowLocation “France” |
showsheet | Method | Displays a map sheet. This is equivalent to selecting a sheet in the map sheet dropdown in the map pane toolbar, but without displaying any popup messages. If the sheet doesn’t exist or isn’t in the correct format, nothing happens. | Sheet name | ShowSheet “Europe” |
taskpane | Function | Displays or hides the map pane. Returns true if it currently being displayed, false otherwise | Boolean | TaskPane cmbTaskPane.value |
taskpanemenu | Function | Displays or hides the menu bar at the top of the map pane. Returns true if it currently being displayed, false otherwise. You should set this to false when displaying a URL | Boolean | TaskPaneMenu cmbTaskPaneMenu.value |
url | Function | Displays the url that the map pane is currently displaying | MsgBox URL | |
zoomtoicons | Method | Zooms the map to fit everything that’s been drawn (icons, circles, directions, etc) | ZoomToIcons |
Any chance of getting a copy of source code of GeodesiX
Sure: on sourceforge