Path

ez projects / ezgmaplocation / forum / general / allow multiple gmaps keys (...


Allow multiple gmaps keys (one per domain)

You need to be logged in to post messages in the forums. New users may register here.

Carlos Revillo

Member since:
09 January 2008

Posts: 53

Monday 05 April 2010 7:06:56 pm

Hi. Currently only one google maps key can be defined in ini file. It could be nice to have the posibility to define several keys, one for each (sub)domain involved in your project.

this could be nice for having gmaps working in development and production domains. Also it could be good for sites having multihost acces type and having subdomains like spanish.mysite.com and english.mysite.com, for example.


Probably we could define these keys in each siteaccess, but i suggest to define an array of keys like




GMapsKey[sub1.domain.com]=...


GMapsKey[sub2.domain.com]=...


GMapsKey[www.domain2.com]=...


...




and then in templates work with ezsys like



{def $keys = ezini('SiteSettings','GMapsKey')}


<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={$keys[ezsys( 'hostname' )]}&amp;sensor=true" type="text/javascript"></script>




Best wishes
Up

You need to be logged in to post messages in the forums. New users may register here.