Hi Shanika
Just remove the api key reference and try running your application. V3 does
not require an api key.
here is an example
<!DOCTYPE html><html> <head> <meta http-equiv="content-type"
content="text/html;
charset=utf-8" /> <title>Rectangle Overlay</title>
<style type="text/css"> #map { width: 800px; height: 500px; } </style>
<script type="text/javascript" src="
http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript"> // Global variables var map; var
marker1;var marker2;var rectangle;
/** * Called on the initial page load. */ function init() { map = new
google.maps.Map(document.getElementById('map'), { 'zoom': 3, 'center': new
google.maps.LatLng(70, 0), 'mapTypeId': google.maps.MapTypeId.ROADMAP });
// Plot two markers to represent the Rectangle's bounds. marker1 = new
google.maps.Marker({ map: map, position: new google.maps.LatLng(65,
-10),draggable: true, title:
'Drag me!' }); marker2 = new google.maps.Marker({ map: map, position: new
google.maps.LatLng(71, 10), draggable: true, title: 'Drag me!' }); //
Allow user to drag each marker to resize the size of the
Rectangle.google.maps.event.addListener(marker1, 'drag',
redraw);google.maps.event.addListener(marker2, 'drag', redraw); //
Create a new Rectangle overlay and place it on the map. Size //
will be determined by the LatLngBounds based on the two Marker //
positions.rectangle = new google.maps.Rectangle({map: map});redraw();
} /** * Updates the Rectangle's bounds to resize its dimensions.
*/function redraw() {var latLngBounds = new google.maps.LatLngBounds(
marker1.getPosition(), marker2.getPosition()
);rectangle.setBounds(latLngBounds);
}
// Register an event listener to fire when the page finishes
loading.google.maps.event.addDomListener(window, 'load', init);
</script> </head> <body> <h1>Drag the markers to move the rectangle.</h1> <div
id="map"></div> </body></html>
Aveek K Biswas
On Thu, Jul 26, 2012 at 12:32 PM, Shanika Nishani <[email protected]>wrote:
>
> hi frndz..
>
> i worked with google map api v2,it was fine. then i wanted to move to api
> v3.i used the key i got from google,
> but when i run my app it displays an error saying ( i used the same
> app,just change the key and the methods)
>
> "Google has disabled use of the Maps API for this application. The
> provided key is not a valid Google API Key, or it is not authorized for the
> Google Maps Javascript API v2 on this site. If you are the owner of this
> application, you can learn about obtaining a valid key here:
> http://code.google.com/apis/maps/documentation/javascript/v2/introduction.html#Obtaining_Key
> "
>
> I cleared my browser cache also,but it still same.what should i do now
> ,plz help me
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-maps-js-api-v3/-/wM8I2-eC0QEJ.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.