Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

6 Commits

Repository files navigation

vbWebMap

A simple map UI proof of concept written in VB6 compatible VBA

example

This map uses InternetExplorer COM object.

Important: This currently relies on GeoJSON.io. It would be a lot better if it relied on some github.io page. I.E. something that wouldn't go down. However, on the whole this could prove useful as a basis for more resilient works. :)

The example supplied will visualise the linked table. Furthermore when you change row in Excel, the point displayed in the map will shift around also.

VBA Classes

vbWebMap

Driver for the web map. Contains a few subs to add layers, set the bounds of the map, and pan to a point.

'Constructorscreate()'Properties and methodsapi'entry point to window.apileaflet'entry point to window.LpanTo(latasdouble,lngasdouble)'pan to a pointsetBounds(lat1asdouble,lng1asdouble,lat2asdouble,lng2asdouble)'sets the bounds of the webmap to a rectaddLayer(layerasgisFeatureCollection)'sets the active layergetMarkerStyle(ByValcolorAsLong,symAsEMarkerSymbol,sizeAsEMarkerSize)'helper for styling markersisIERunning'property to test whether IE is running or not

gisFeatureCollection

Creates a geoJSON layer.

'Constructorscreate()'Properties and methodsAddPoint(ByValpointAsgisIPoint,OptionalByValDataAsObject)'Add a point to the collection. Optionally include data.AddPoint2(ByValLatitudeAsDouble,ByValLongitudeAsDouble,OptionalByValDataAsObject)'Add a point to the collection. Optionally include data.AddLine(ByValoStartAsgisIPoint,oEndAsgisIPoint,OptionalByValDataAsObject)'Add a line to the collection. Optionally include data.AddLine2(ByValStartLatAsDouble,StartLongAsDouble,EndLatAsDouble,EndLongAsDouble,OptionalByValDataAsObject)'Add a line to the collection. Optionally include data.AddPolygon(ByValvPolygonAsVariant,OptionalByValDataAsObject)'Add a polygon to the collection. Optionally include data.AddPolyLine(ByValvPolylineAsVariant,OptionalByValDataAsObject)'Add a line to the collection. Optionally include data.ToString()'returns the layer as geoJSONobject'obtain the object itself (not really used)bounds'obtain bounding rect as array

gisOSGB36

Implements gisIPoint. Handles OSGB36 to LatLng conversion.

'ConstructorsCreate(ByValEastingsAsDouble,ByValNorthingsAsDouble)AsgisOSGB36'Creates point from eastings and northingsCreateFromLatLng(ByValfLatitudeAsDouble,ByValfLongitudeAsDouble)AsgisOSGB36'Creates point from latitude and longitude (can convert to Eastings Northings this way)CreateFromString(ByValsGridReferenceAsString)AsgisOSGB36'Creates point from string. Numerous formats are allowed including:' 123456-123456' SK123456' SK1234567890'Properties and methodsEastings'eastings coordNorthings'northings coordLatitude'latitude coordLongitude'longitude coordgisIPoint_Latitude'latitude coordgisIPoint_Longitude'longitude coord

gisIPoint

Interface containing Latitude() and Longitude() functions.

About

A simple map UI proof of concept written in VB6 compatible VBA - Requires Internet Explorer

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages