Alternate View Google Map JavaScript Methods

Description

Methods can be called directly on the JavaScript object for the Grid Map object in the Grid Component.

These are method of the Grid map object, which is not the the same as the Google map object. To get a pointer to the Grid map object, use this syntax:

var mapId = {grid.object}.googleMap_mapId;

The map id is defined in the Alternate View properties.

So, for example, if the map Id is 'VIEW1', the pointer to the Grid map object is:

var view1Id = {grid.object}.googleMap_VIEW1;

To get a pointer to the underlying Google map object you add .map to the Grid map object. For example:

var mapObj = {grid.object}.googleMap_VIEW1.map;

Once you have a pointer to the Google map object, you can refer to the Google Maps API documentation to see what methods are available.

//callback from Google Maps startup
//Geocode or otherwise set the initial map center,
// then chain to initialize2
.initializeGoogleMap()

//Try to Geocode the supplied address, then chain to initialize2
.encodeAddress(address)

//This function is chained from initialize or encodeAddress
//Set map options, create map object, add map click listener,
// mark initial position if wanted, and create bulk loaded markers
.initialize2(myLatLng)

//addBulkMarkersCallback: add contents of markerArray argument to bulk markers
// API exposed for use by Ajax callbacks; called by initialize2
.addBulkMarkersCallback(markerArray, fClearAllMarkers, fClearBulkMarkers,
 fRecenterMapNew, fRecenterMapAll)

//doGeocode: address into LatLng, if we can
// Note that geocoding is asynchronous
.doGeocode(address, title, infotext, icon, rowNumber, layer, animation,
 duration, callback, [opt]circleObj)

.doGeocode2(address, canDrag)

.openInfoWindow)index) //index is Xbasic 1-based row number

.addBulkMarker2(lat, lng, title, infotext, icon, rowNumber, layer, animation,
 duration, callback, [opt]circleObj)


//addBulkMarker: Add the LatLng marker, with infotext, title, icon, layer,
// animation, duration, callback, and optionally a circle
// Also update bounds
//rowNumber can be used by a defined bulkMarkerClickAction
.addBulkMarker(latlng, title, infotext, icon, rowNumber, layer, animation,
 duration, callback, [opt]circleObj)

//reset map bounds to fit all markers if wanted
.autoScaleMap()

.addMarker2(lat, lng, canDrag)

//Add a marker to the map with a title and InfoText box
//Add a listener for marker drag events
//Show updated polygon if wanted
//Show circle for the first marker if wanted
.addMarker(location, canDrag)

//Attach an InfoText ballon to a specified marker
//Add a listener to the marker to show the InfoText
.attachInfoText(marker, num)

//Geocode the address in the address input box or optional address argument
//If successful, make this the new map center, reinitialize
// the markers, and add this as a new first marker
.encodeAddressField([opt]address)

//Hide bulk markers in a given layer
.hideLayer(layer)

//Show bulk markers in a given layer
.showLayer(layer)

.bounceLayer(layer, seconds, action)

.bounceBulkMarker(index, seconds, action)

//Remove the markers from the map, but keep them in the array
.clearOverlays()

//Show any markers currently in the array
.showOverlays()

//Turn marker displays on or off
.toggleMarkers()

.deleteBulkMarkers()

//Delete all markers in the arrays
//also calls .deleteBulkMarkers()
.deleteOverlays()

//Create and show the polygon defined by the markers
.showPoly()

//Hide the polygon
.clearPoly()

//Turn the polygon display on or off
.togglePoly()

//Show a circle on the map around the center point if wanted
//Fit the map to the bounding box of the circle
.setRadius(value)

//Create a URL-encoded string containing the values to post back to the server
.computePostValues()

//Perform an Ajax callback to the Xbasic function 'TakeLatLng'
// using computePostValues() to do the heavy lifting
.SubmitLatLng()

//Ajax callback to do Geocoding
.geoCodeCallback(arg, callback)