Class Details

Class ahgeomap
Version 0.9.

ahgeomap(sDivname, aOptions)
wrapping class for a simple google map.
I want to use it to point cities in my diashows https://www.axel-hahn.de/diashows/
see getter: https://developers.google.com/maps/documentation/javascript/reference
events: https://developers.google.com/maps/documentation/javascript/events

PROJECT HOME: https://www.axel-hahn.de/projects/javascript/ahgeomap/
DOC: https://www.axel-hahn.de/docs/ahgeomap/index.htm
SOURCE: https://github.com/axelhahn/ahgeomap
DEMO: https://www.axel-hahn.de/demos/geolocation-maps/


Author: Axel Hahn.
Version: 0.9.
<div id="divmap"></div>
(...)
<script>
  var oMap=new ahgeomap("divmap");
</script>
Parameters:
{string} sDivname
- id of an existing div
{object} aOptions
- map options to override (optional)
Returns:
none

Public Methods

addLineFromHomeToTarget

{undefined} addLineFromHomeToTarget(lat, lng)

draw a line from users position to target

Parameters:
{float} lat
position - latitude
{float} lng
position - longitude
Returns:
{undefined}

addMapListener

{Boolean} addMapListener(name, sFunction)

add a listener to the map ... then you can react on changes like zoom, movement or events like mousemove, clicks etc.

Parameters:
{string} name
of the event you want to listen
{function} sFunction
Returns:
{Boolean}
See:
available events https://developers.google.com/maps/documentation/javascript/events

addMarker

{undefined} addMarker(title, lat, lng, sDescr)

set a marker icon

Parameters:
{string} title
title
{float} lat
position - latitude
{float} lng
position - longitude
{string} sDescr
more text
Returns:
{undefined}

addMarkerOnHome

{undefined} addMarkerOnHome(title, sDescr)

set a marker icon on users position

Parameters:
{string} title
title
{string} sDescr
more text
Returns:
{undefined}

getCurrentPosition

{boolean} getCurrentPosition()

get current position and fill it into internal position vars; function returns return success of navigator.geolocation.getCurrentPosition

Returns:
{boolean}

getHomePosition

{object} getHomePosition()

get the position of the user (this returns the saved position of getCurrentPosition()

Returns:
{object}

getMapCenter

{position} getMapCenter()

get the position displayed at the center of the map. Note that this LatLng object is not wrapped.

Returns:
{position}

getMapZoom

{Integer} getMapZoom()

get zoom level of the visible map

Returns:
{Integer}

setAsHomePos

{Boolean} setAsHomePos(position)

set home position; callback of navigator.geolocation.getCurrentPosition in this.getCurrentPosition

Parameters:
{object} position
position object
Returns:
{Boolean}

setHomePosition

{Boolean} setHomePosition()

move map to users position

Returns:
{Boolean}

setOptions

{Boolean} setOptions(aOptions)

set options and override defaults of see this._aMapOptions

Parameters:
{object} aOptions
map options
Returns:
{Boolean}

setPos

{Boolean} setPos(position)

move map to a new position with a given position object

Parameters:
{object} position
position object
Returns:
{Boolean}

setPosition

{Boolean} setPosition(fLat, fLong, iZoom)

move map to a new position by given coordinates

Parameters:
{float} fLat
latitude
{float} fLong
longitude
{type} iZoom
zoom level
Returns:
{Boolean}

setZoom

{Boolean} setZoom(iZoom, bUpdateMap)

set zoomlevel of a map

Parameters:
{integer} iZoom
zoomlevel: 1=far .. 15=close
{bool} bUpdateMap
update map; default = false
Returns:
{Boolean}

showMap

{undefined} showMap()

initialize and draw a map

Returns:
{undefined}

updateMap

{undefined} updateMap()

update existing, visible map: move to given poition; set zoom https://developers.google.com/maps/documentation/javascript/reference#Map

Returns:
{undefined}

Documentation was generated by JsDoc Toolkit 2.4.0






Copyright © 2020 Axel Hahn
project page: GitHub (en)
Axels Webseite (de)
results will be here