Description

Sets the center of map to the address that you specify.

Function syntax

ColdFusion.Map.setCenter("name", centerConfigObject)

See also

ColdFusion.Map.addMarkerColdFusion.Map.getLatitudeLongitudeColdFusion.Map.getMapObject
ColdFusion.Map.setZoomlevel

History

ColdFusion 9: Added this function

Parameters

Parameter

Description

name

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

centerConfigObject

The Center Address object. The value of this object can either be the longitude/latitude value or the address property.

Returns

This function does not return any value.

Example 1

<h3>This is an example of the Map.setcenter function using latitude-longitude and address values</h3>
<script>
var centerLongLat={
latitude: 71.094224,
longitude: 42.339641
};
var center={
address: '345 Park Avenue, san jose, CA 95110-2704, USA'
};
function setcenter()
{
ColdFusion.Map.setCenter('mapID', centerLongLat);
}
function setcenterlatlong()
{
ColdFusion.Map.setCenter('mapID', center);
}
</script>
<h3>MAP 1</h3>
<cfform name="mapID">
Click this button to set the center using Latitude and Longitude.
<cfinput type="button" value="setCenter using lattitude-longitude"
name="buttn01" onclick="javascript:setcenterlatlong();">
<br>Click this button to set the center using Address.
<cfinput type="button" value="setCenter using Address"
name="buttn01" onclick="javascript:setcenter();">
</cfform>
<cfmap name="mapID" centerlatitude=71.094224
centerlongitude=42.339641
displayscale=true
doubleclickzoom="true"
overview=true
scrollwheelzoom=true
tips="My Map"
zoomlevel="4">
</cfmap>

 

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy