0

I'm running CF, on windows 2008 r2 9,0,1,274733 hf901-00010.jar

An older application I wrote that used CFMAP stopped working.

In developer tools I get this error:

Uncaught TypeError: Cannot read property 'SMALL' of undefined cfmap.js:110
ColdFusion.Map.init cfmap.js:110
_cf_map_init_1379964514322 zip.cfm:29
fire cfajax.js:1105
$E.windowLoadHandler cfajax.js:1209

I created a basic page taking an example right from CFDOCS:

<cfmap name="gmap02" 
    centeraddress="345 Park Avenue, san jose, CA 95110-2704, USA" 
    doubleclickzoom="true" 
    scrollwheelzoom="true" 
    showscale="false" 
    tip="My Map"/> 

Any ideas on what may have changed?

steve
  • 1,490
  • 10
  • 18
  • Stopped working after what change? Did you upgrade, move to a different server, ...? – Leigh Sep 23 '13 at 21:44
  • 1
    Perhaps you are using the [v2 Geocoding Web API which was turned off the beginning of the month](http://stackoverflow.com/questions/18743128/recieving-a-403-forbidden-error-when-using-latitude-and-longitude-geocoding/18745224#18745224)? – geocodezip Sep 24 '13 at 00:32
  • same server, same everything. @geocodezip coldfusion provides a simple tag that allows me to just pass the address as above, and it does the rest. May it takes advantage of the geocoding web api v2. – steve Sep 24 '13 at 02:11
  • Yeah, @geocodezip is probably right. If you look at the [documentation for cfmap](http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSAC308487-F029-4f89-BAFB-B410E145E86E.html), several comments mention issues with lack of support for later versions. (Side note, I am surprised there have not been a slew of comments yet - recommending you stop using the CF ajax stuff, for reasons like this ;-) – Leigh Sep 24 '13 at 02:29
  • 3
    This is why you should not use the UI bits in ColdFusion. Learn how to do it the right way. – Scott Stroz Sep 24 '13 at 13:15
  • I ended up just going with a quick fix: http://gmap3.net/. Part of the CF charm back in the day was the built in functionality for just pulling quick stuff. – steve Sep 24 '13 at 17:57
  • 1
    _Part of the CF charm back in the day ..._ that is absolutely right, back in the day. jQuery and the like did not exist back then. But they do now. Ben Forta Blog - [When Using ColdFusion (Client Functions) No Longer Makes Sense](http://forta.com/blog/index.cfm/2012/11/25/When-Using-ColdFusion-No-Longer-Makes-Sense) – Miguel-F Sep 24 '13 at 18:24

2 Answers2

2

As stated above the reason for it not working is that v2Geocoding Web API has been turned off. However, the comments did not provide a solution. I personally have used this function several times before and it looks like it is still working.

http://cfgmap.riaforge.org/

It is basically a modified version of cfmap.

Cory Fail
  • 1,070
  • 8
  • 26
1

Adobe released Cumulative Hotfix 4 for ColdFusion 9.0.1 in Feb/March 2013 that added support for Google Maps API v3. http://helpx.adobe.com/coldfusion/kb/cumulative-hotfix-4-coldfusion-901.html.

You need to have the cumulative hotfix installed for it to work with v3 of the API.

To check, look in {cf_install}/lib/updates. There should be chf9010004.jar in the directory. Also there were quite a few files in /CFIDE/scripts/ that were also updated to support it as well.

If you are running CF9.0.0 or 9.0.2 there were other CHFs released for the specific version to support the newer API. For ColdFusion 10 you need to be running Update 8 or higher.