I am developing a cms that will use more than one domain and i have to use only one google map script in my page. Is there a way to use google maps without api key? Otherwise it's not working?
Fairly confident that in order to use their API you need an API Key.
Perhaps Google maps premiere can adhere to your specific problem?
Can you add an ApplicationSetting to your Web.Config file like so
<appSettings>
<add key="GoogleMapAPI" value="XXXXXX" />
</appSettings>
for each domain?
Then add this to your Page
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=<%=ConfigurationManager.ApplicationSettings["GoogleMapAPI"] %>&hl=de"
You could rig up something similar using your database or your host headers to manage each key per domain.
The Google Maps API V3 does not require a key.
Like V2, however, you can only use it for applications which are free and publicly accessible. If it's for a commercial product, you'll need the Google Maps API Premier
If you want to vary the API key (for V2) in JavaScript, you can write a wrapper that contains the code for starting your map. The JS code then outputs an API key based upon the host name:
if (document.domain=="[HOSTNAME 1]") {
document.write('[JS TAG to Google Maps API with HOSTNAME 1 Key]')
} else if (document.domain=="[HOSTNAME 2]") {
document.write('[JS TAG to Google Maps API with HOSTNAME 2 Key]')
etc...