googleMapKey doesn't work on Application.cfc neither using <cfajaximport>

Hi,

I don’t know if I’m doing something wrong, but setting this.googlemapkey in the Application.cfc or using <cfajaximport> to set the API key doesn’t work.

Application.cfc:

component {
    this.customTagPaths = './app/tags/';
    this.googlemapkey = 'MY_GOOGLE_API_KEY';
}

Or directly within the .cfm template:

<cfajaximport params="#{GoogleMapKey='MY_GOOGLE_API_KEY'}#">
<cfmap type="map" centerlatitude="-23.5239623" centerlongitude="-46.8411243" zoomlevel="10"></cfmap>

Any help about it?

OS: Windows 10
Java Version: 1.8
Tomcat Version: 9.0.35
Lucee Version: 5.3.8.175-RC

Hi Jhonatan,

very probably you won’t hear much on cfmaps/cfajax stuff, because these tags may look promising on first sight, but they have been proven not to be very suitable to implement. A vast number of us cfml developers don’t use it and avoid such tags, becuse they generate potentially uncontrollable front end UI code and you at some point may/will loose control if you need to tweak it.
That is why these are marked and flagged at cfmap CFML Documentation

We encourage you to build your own custom solution and avoid these tags. If you don’t, you’ll need to rewrite anyway later, because it won’t do the things as you may need at some point.

1 Like