ColdFusion.Map.getMapObject

Description

Gets the Google map component. You can manipulate the map using supported Google Map APIs.

Function syntax

ColdFusion.Map.getMapObject("name")

See also

ColdFusion.Map.addMarkerColdFusion.Map.getLatitudeLongitudeColdFusion.Map.setCenter
ColdFusion.Map.setZoomlevel

History

ColdFusion 9: Added this function

Parameters

Parameter

Description

name

Specifies the value of the name attribute of the cfmap tag.

Returns

This function returns the Google map component. The map type can be map, satellite, or hybrid.

Example

<h3>This is an example of the Map.getmapObject function. Click the HTML button labeled "GetMap" to get the map object and set the center to Palo Alto.</h3>
<script>
function getMapObject()
{
var mapObj = ColdFusion.Map.getMapObject('mapID');
mapObj.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
</script>
<h3>MAP 1</h3>
<cfform name="map01">
<cfinput type="button" value="getMapObject and setCenter" name="htmlbutton"
onclick="javascript:getMapObject()">
</cfform>
<cfmap name="mapID"
centerAddress='201 S. Division St. Suite 500 Ann Arbor, MI 48104'
displayscale=true
doubleclickzoom="true"
overview=true
scrollwheelzoom=true
tips="My Map"
zoomlevel="4">
</cfmap>

 

Get help faster and easier

New user?