How to setup Google Maps API Key

Before going further, I suppose you have installed the GoogleMap control to your web application/project.
Also make sure you have obtained a Google Maps API key for your web application.
You can do so at Google Maps API - Sign Up

So, you can set obtained Google Maps API Key in web.config file or per every GoogleMap control.
If you setup the key in web.config file there is no need to provide it to every GoogleMap control by Key property.
The control will automatically get it from web.config.
Have in mind the key set through Key property overrides the one from web.config.
  • Set the key in web.config
<appSettings>
	<!-- Google Maps API key for demo.artembg.com -->
	<!-- Change this with your proper key -->
    <add key="GoogleMapKey" value="ABQIAAAAyWjvj4t-s3JAHKCxqTvdRBRUOoL5jeCxUcLYWEpv1-lnR3ABuxR-E0rBRImyn41cOYkfId9d_gYHKg"/>
</appSettings>
  • Set the key per control
<artem:GoogleMap ID="GoogleMap1" runat="server" Key="ABQIAAAAyWjvj4t-s3JAHKCxqTvdRBRUOoL5jeCxUcLYWEpv1-lnR3ABuxR-E0rBRImyn41cOYkfId9d_gYHKg" Width="530px" Height="500px" Latitude="42.1229" Longitude="24.7879"
    Zoom="5">
</artem:GoogleMap>


That's all for now folks.
Happy coding ...

Any smart ideas and comments are welcome. Please do not hesitate to question me
See more about me and my works under ArtemBG | WebUtil.net

Last edited Oct 25, 2009 at 10:28 AM by velio, version 4

Comments

No comments yet.