Module with geolocation methods.

For working with this module you need to have enabled geolocation in your browser.

Map

This shows map with your location on Google Maps. You need to obtain API key for Google Maps. Look into documentation how to get it and replace YOUR_API_KEY in this usage:

<div id="map"></div>

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script>
<script src="vendor/hermajan/lib/src/geo/geolocation.js"></script>
<script src="vendor/hermajan/lib/src/geo/gmaps.js"></script>
<script type="text/javascript">	
	locate(function(position) {
		showGMap(position, "map");
	}, false);
</script>

Location information

This shows information about your location. Include it in your page like this:

<div id="geolocation"></div>

<script src="vendor/hermajan/lib/src/geo/geolocation.js"></script>
<script type="text/javascript">	
	locate(showPosition, "geolocation");
</script>

Examples