This follows on from a recent thread at https://www.access-programmers.co.uk...ht=geolocation
After making further modifications to fix various issues e.g. Mark of the Web (MOTW), attached is an improved utility for determining your current geolocation
All supplied files need to be in the same folder
To use this, click 'Get Current Location
'. A browser window will open and ask permission to obtain your location.
Click the 'Allow Once
' button within 3 seconds to do so
Your current location should be shown on the map & your latitude / longitude displayed.
The browser window will then close & the geolocation data shown in Access together with a static map centred on that. The map can be nudged or zoomed as required.
is also used to obtain a shortened address for the location which should be accurate to within a few metres.
If you don't click the button in time, you will be offered further 'chances' to do so
The example database was created in Access 2010 32-bit and Windows 10.
However, it has been successfully used in all versions of Access from 2007 through to 2016 (both 32-bit & 64-bit).
It works in any version of Windows from Win7 SP1 onwards
1. You must switch on location services in Windows settings / Control Panel
2. Your computer must contain a geosensor (all tablets / many laptops / not many desktops)
3. There is a bug affecting Internet Explorer in the latest update 1803 to Windows 10.
The browser window will report "Error - the geolocation service failed"
It doesn't matter which browser is your default, IE is always used by Access for browser related code.
I have reported this to Microsoft who have acknowledged it as a bug for attention (when?)
4. The form includes an ActiveX slider control - this will not work if you have disabled ActiveX completely in Access settings
If you cannot get your location for any of the above reasons (or to do this for another location), you can obtain latitude & longitude data in other ways e.g.
a) Open Google maps to your current location
b) Use GPS data from a mobile phone or other device with a geosensor
c) Use a Windows app such as Sensor List or Geolocator (free from the Windows Store)
d) Take a photo using your PC webcam then use the GPS data from the photo properties
Enter the values on the form then click 'Search'
The geolocation code & map requires a Google Maps API key.
The supplied API key will stop working on (or before) 16 July 2018
(postponed from 11 June) when Google will require users to enable billing and associate it with all Google Maps Platform projects. However there is a fairly generous monthly free allowance & small/medium users of Google Map APIs should still be able to download various maps without incurring charges
Please follow the instructions on this form to obtain your own free API key from https://cloud.google.com/maps-platform
and use it in place of the existing key.
An enhanced version of this utility is included in the next version of my UK Postal Address Finder database
(to be released early June 2018)
It is used to locate the nearest postcodes for the current location (or any other geolocation).
That info is then used to find nearby places within a specified radius e.g. restaurants within 500 metres
If you are interested, please see the attached video