cfmap
Description
Embeds a geographical map within a ColdFusion web page.
Categories
Related
History
ColdFusion
9: Added this tag.
Syntax
<cfmap
centeraddress="address"
centerlatitude="latitude in degrees"
centerlongitude="longitude in degrees"
collapsible="true|false"
continuouszoom="true|false"
doubleclickzoom="true|false"
height="integer"
hideborder=""
markerbind="bind expression"
markercolor="marker color"
markericon="icon path "
markerwindowcontent="content"
name="name"
onerror="JavaScript function name"
onload="JavaScript function name"
overview="true|false"
scrollwheelzoom="true|false"
showallmarkers="true|false"
showcentermarker="true|false"
showmarkerwinodw=""true|false"
showscale="true|false"
tip="center property marker tips"
title="string"
type="map|satellite|hybrid|earth|terrain"
typecontrol="none|basic|advanced"
width="integer"
zoomcontrol="none|small|large|small3d|large3d"
zoomlevel="integer"
</cfmap>
Attributes
| Attribute | Description | Required | Default |
|---|---|---|---|
| centeraddress | The address of the location, which is set as the center of the map. | Required if centerlatitude and centerlongitude are not specified | |
| centerlatitude | The latitude value for the location, in degrees. This value is set as the center of the map. This attribute must be used with the centerlatitude attribute. | Required if centeraddress is not specified | |
| centerlongitude | The longitude value for the location, in degrees. This value is set as the center of the map. This attribute must be used with the centerlongitude attribute. | Required if centeraddress is not specified | |
| collapsible | Whether to provide a collapsible property for the surrounding panel:true false If you set collapsible to true, you cannot set hideborders to true. | Optional | false |
| continuouszoom | Whether to provide zoom control that enables smooth zooming for the map:true false | Optional | true |
| doubleclickzoom | Whether to enable double-click zoom:true false | Optional | true |
| height | Height of the map, in pixels. | Optional | 400 pixels |
| hideborder | Whether to hide border for surrounding panel:true false If you set hideborder to true, you cannot set collapsible to true. | Optional | true |
| markerbind | A bind expression to dynamically populate data in the window that is opened when you click the marker icon. The bind expression can specify a CFC function, a JavaScript function, or a URL. | Optional | |
| markercolor | Indicates the color of the marker. Specify a string value, for example "black", "red", or "green". By default, the centermarker is green in color. The attributes markericon and markercolor are mutually exclusive. | Optional | |
| markericon | Location of an image file to use as the marker icon. The attributes markericon and markercolor are mutually exclusive. | Optional | |
| markerwindowcontent | Static content displayed in the marker window. This attribute is mutually exclusive with the markerbind attribute. | Optional | |
| name | Name of the map. The name attribute is required to invoke JavaScript functions. | Required | |
| onerror | The JavaScript function to run when there is a Google map API error. The JavaScript function is passed with two parameters, Google map status code and error message. | Optional | |
| onload | Custom JavaScript function that runs after the map loads, for instance, registering an event. | Optional | |
| overview | Whether to add an Overview panel to the map:true false | Optional | false |
| scrollwheelzoom | Whether to enable mouse wheel zooming control:true false | Optional | true |
| showallmarkers | Whether to display all markers added to the map:true false When you specify showallmarkers as true, to display all the markers within the map area, the zoom level specified for the map may be overridden. | Optional | true |
| showcentermarker | Whether to display the marker icon that identifies the map center:true false | Optional | true |
| showmarkerwindow | If set to true, displays the marker window. If the attribute markerbind is used, unless you set this attribute to true, the marker window is not displayed. This attribute is ignored if markerwindowcontent is set to true. | Optional | false |
| showscale | Whether to show scale control:true false | Optional | false |
| tip | A short description of the center location that appears as a tool tip. | Optional | |
| title | Title of the panel. You cannot define a title, if you set hideborder to true. | Optional | |
| type | Type of the Google map:map satellite hybrid terrain earth: If you use type="earth", you are prompted to download Google Earth 3D plug-in. | Optional | map |
| typecontrol | Whether to provide a type control that lets you switch the map:basic: Displays a drop-down list that provides the options map, satellite, and hybrid. none advanced: Displays a drop-down list with five options defined for the attribute type. | Optional | basic |
| width | Map width, in pixels. | Optional | 400 pixels |
| zoomcontrol | Whether to enable zoom control:none small large large3d small3d | Optional | small |
| zoomlevel | Specifies the starting zoom value. | Optional | 3 |
Usage
This tag can be used to create a map within an HTML page, a div tag, or in a new window. If you use this tag in a new window, you must use the cfmap tag within the cfwindow tag.
The zoomcontrolattribute lets you change the size of the embedded map. You can increase the zoom value to get a close-up view of the map. Or, decrease the zoom value to view a larger area of the map at a reduced size. Each time you change the zoom value, the entire map does not refresh, but only those portions of the map that change, making the display of data fast.
The cfmap tag supports the map display in five formats - map, satellite, terrain, earth, and hybrid. The map format displays a standard road map image. The satellite format displays a satellite image of the map. The hybrid format displays a combination of the roadmap and the satellite image of the map, with important street names and places marked on the satellite image.
The following attributes do not work if type="earth": Zoomlevel, showScale, overview, tip, zoomControl, showCenterMarker, and showAllMarkers.
For cfmap tag to work on Safari 3.x and Google Chrome, specify the HTML head tag (<head></head>).
The zoomcontrolattribute lets you change the size of the embedded map. You can increase the zoom value to get a close-up view of the map. Or, decrease the zoom value to view a larger area of the map at a reduced size. Each time you change the zoom value, the entire map does not refresh, but only those portions of the map that change, making the display of data fast.
The cfmap tag supports the map display in five formats - map, satellite, terrain, earth, and hybrid. The map format displays a standard road map image. The satellite format displays a satellite image of the map. The hybrid format displays a combination of the roadmap and the satellite image of the map, with important street names and places marked on the satellite image.
The following attributes do not work if type="earth": Zoomlevel, showScale, overview, tip, zoomControl, showCenterMarker, and showAllMarkers.
For cfmap tag to work on Safari 3.x and Google Chrome, specify the HTML head tag (<head></head>).