For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
Using Ajax User Interface Components and Features / 

Using geographical maps

Adobe Community Help


Applies to

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

The cfmap tag lets you embed a geographical map within your ColdFusion page. The following are the supported map types:

  • earth
  • terrain
  • satellite
  • hybrid
  • map (default)

Using the marker window

The marker window opens when you click the marker icon in the map. It is used to provide information pertaining to the locations in the map, for example address or latitude and longitude. The marker window can be populated with static or dynamic content.

Populating data using static content

To manually populate data in the marker window, specify the value in the markerwindowcontent attribute.

Populating dynamic data using bind expression

To dynamically populate data, use the markerbind attribute with a bind expression that calls a CFC, JavaScript function, or a URL. The bind expression uses bind parameters to specify dynamic information and the values of any other form field attributes. 
Pass the bind parameters to the bind expression. If you omit any of the parameters in the function call or URL, you get an error. These parameters send information about the map and its state to the data provider function. The data for these parameters is provided automatically. You do not set any values manually.
Provide the data as provided in the following code:

<br>
<cfoutput>
<table>
<tr>
<td bgcolor='red'><h4><font color='white'>URL Bind Example</font></td>
</tr>
</table>
Map Name: #cfmapname#<br>
Latitude, Longitude: (#DecimalFormat(cfmaplatitude)#,#DecimalFormat(cfmaplongitude)#)<br>
Address: #cfmapaddress#<br>
</cfoutput>

The following table provides details of the parameters:

Parameter name

Description

cfmapname

The name of the map.

cfmaplatitude

The latitude value for the location, in degrees. This value is set as the center of the map.

cfmaplongitude

The longitude value for the location, in degrees. This value is set as the center of the map.

cfmapaddress

The address of the location, which is set as the center of the map.

The format of the returned data depends on how you get the data:

Bind type

Return value

CFC

A ColdFusion structure. ColdFusion automatically converts the structure for return to the caller. Alternatively, you can return a JSON representation of the structure.

URL

A JSON representation of a structure. No other body contents is allowed.

JavaScript

A JavaScript object.

Use the showmarkerwindow attribute to control the display of the window.
The following example uses a bind expression and a CFC to populate dynamic data using a CFC bind expression. The CFML page contains the following:

<br>
<cfmap
centeraddress="Hobart, Tasmania, Australia"
name="map1"
type="map"
tip="Hobart, Tasmania, Australia"
zoomControl="small3d"
markerbind="cfc:maps.getMapData({cfmapname}, {cfmaplatitude}, {cfmaplongitude}, {cfmapaddress})"
showmarkerwindow = true>
<cfmapitem name="m1" address="Taj Mahal, Agra, India" tip="Taj Mahal, Agra, India">
<cfmapitem name="m2" latitude="40.46" longitude="117.05" showmarkerwindow=true tip="Great Wall of China, Bejing">
<cfmapitem name="m3" address="Stonehenge, England" tip="Stonehenge, England" showmarkerwindow = false>

</cfmap>

The map.cfc is as follows:

<cfcomponent>
<cffunction name="getMapData" access="remote">
<cfargument name="cfmapname">
<cfargument name="cfmaplatitude">
<cfargument name="cfmaplongitude">
<cfargument name="cfmapaddress">
<cfsavecontent variable="markup">
<br>
<cfoutput>
<table>
<tr>
<td bgcolor='red'><h4><font color='white'>CFC Bind Example</font></td>
</tr>
</table>
Map Name: #cfmapname#<br>
Latitude, Longitude: (#DecimalFormat(cfmaplatitude)#,#DecimalFormat(cfmaplongitude)#)<br>
Address: #cfmapaddress#<br>
</cfoutput>
</cfsavecontent>
<cfreturn markup>
</cffunction>
</cfcomponent>

The following example shows how to populate dynamic data using a JavaScript bind expression:

<script language="JavaScript">
var getMapData = function(cfmapname, cfmaplatitude, cfmaplongitude, cfmapaddress){
var msg = "";
msg = msg + "Map Name: " + cfmapname + "<br>";
msg = msg + "Latitude,longitude: " + "(" + cfmaplatitude + "," + cfmaplongitude + ")" + "<br>";
msg = msg + "Address: " + cfmapaddress + "<br>";
//alert(msg);
return "<br><table><tr><td bgcolor='red'><h4><font color='white'>" + "Javascript Bind Example" + "</font></td></tr></table><hr>" + msg;
}
</script>
<cfmap
centeraddress="Hobart, Tasmania, Australia"
name="map1"
type="map"
tip="Hobart, Tasmania, Australia"
zoomControl="small3d"
markerbind="javascript:getMapData({cfmapname}, {cfmaplatitude}, {cfmaplongitude}, {cfmapaddress})"
showmarkerwindow = true>
<cfmapitem name="m1" address="Taj Mahal, Agra, India" tip="Taj Mahal, Agra, India">
<cfmapitem name="m2" latitude="40.46" longitude="117.05" showmarkerwindow=true tip="Great Wall of China, Bejing">
<cfmapitem name="m3" address="Stonehenge, England" tip="Stonehenge, England" showmarkerwindow = false>
</cfmap>

The following example shows how to populate dynamic data using a URL bind expression:

<cfmap
centeraddress="Hobart, Tasmania, Australia"
name="map1"
type="map"
tip="Hobart, Tasmania, Australia"
zoomControl="small3d"
markerbind="url:mapdata.cfm?cfmapname={cfmapname}&cfmaplatitude={cfmaplatitude}&cfmaplongitude={cfmaplongitude}&cfmapaddress={cfmapaddress}"
showmarkerwindow = true >
<cfmapitem name="m1" address="Taj Mahal, Agra, India" tip="Taj Mahal, Agra, India">
<cfmapitem name="m2" latitude="40.46" longitude="117.05" showmarkerwindow=true tip="Great Wall of China, Bejing">
<cfmapitem name="m3" address="Stonehenge, England" tip="Stonehenge, England" showmarkerwindow = false>

</cfmap>

Specifying Google map key

The Google Maps API key is required to embed Google Maps in your web pages.
The following URL provides details of how to sign up for the Google Maps API key:
http://code.google.com/apis/maps/signup.html
Currently, ColdFusion supports only embedding of Google map. To generate a map, provide a valid Google map API key, and specify the latitude and longitude of the location, or the address of the location. The Google map API key can be specified in the following ways:

  • Using the cfajaximport tag. You specify the map API key in the params attribute as follows:<cfajaximport params="#{googlemapkey='Map API Key'}#"
  • Using Application.cfc as follows:<cfset this.googlemapkey="Map API Key">
  • Using the Settings page in the ColdFusion Administrator. Specify the map API key in the Google Map Key field. You can also specify the map API key in runtime.cfc.

Styling markers

You can specify the following:

  • Custom marker icon: Specify the path to the icon using the markericon attribute. Ensure that you specify an image of appropriate size.
  • Marker icon color: Use the markercolor attribute. You can specify a color of your preference only for the default icon and not for others.
  • Map title: Use the title attribute.

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

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices