Alternate View Google Map JavaScript Methods


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};

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

//Try to Geocode the supplied address, then chain to initialize2

//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

//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

.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

//Hide bulk markers in a given layer

//Show bulk markers in a given layer

.bounceLayer(layer, seconds, action)

.bounceBulkMarker(index, seconds, action)

//Remove the markers from the map, but keep them in the array

//Show any markers currently in the array

//Turn marker displays on or off


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

//Create and show the polygon defined by the markers

//Hide the polygon

//Turn the polygon display on or off

//Show a circle on the map around the center point if wanted
//Fit the map to the bounding box of the circle

//Create a URL-encoded string containing the values to post back to the server

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

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