Whatever message this page gives is out now! Go check it out!

ColdFusion.Map.setCenter

Last update:
May 18, 2026

Description

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

Function syntax

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

See also

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>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page