Please read and follow the posting guidelines.
http://groups.google.com/group/Google-Maps-API/web/suggested-posting-guidelines

Alternatively, read the documentation for the GMap2 click event.

--
Marcelo - http://maps.forum.nu
--




On Nov 13, 4:03 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I wanted to draw a marker on a map in the exact place where a click on
> the map event has occured,
> ,so I wrote the followimg file:
> _____________________________________________________________________________________
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";>
>   <head>
>     <meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
>     <title>Google Maps JavaScript API Example</title>
>     <script src="http://maps.google.com/maps?
> file=api&v=2&key=ABQIAAAAn4bDX9NIPvUEsfZFiiGGnxT2yXp_ZAY8_ufC3CFXhHIE1NvwkxT_gB8wPILc3zOK33p3PsnaJct0aA"
>       type="text/javascript"></script>
>     <script type="text/javascript">
>
>     //<![CDATA[
>
>     function load() {
>       if (GBrowserIsCompatible()) {
>         var map = new GMap2(document.getElementById("map"));
>         map.setCenter(new GLatLng(32.1823566, 34.9069766), 15);
>         map.addControl(new GLargeMapControl());
>         map.addControl(new GMapTypeControl());
>         GEvent.addListener(map, "click", function(latlng) {
>         var marker = new GMarker(latlng);
>         map.addOverlay(marker);
>         });
>         }
>     }
>
>     //]]>
>     </script>
>   </head>
>   <body onload="load()" onunload="GUnload()">
>     <input type=button name=but value="SatSmart"
> onclick=location.href="sat-smart1.html">
>     <div id="map" style="width: 900px; height:650px">
>     </div>
>   </body>
> </html>
>
> _____________________________________________________________________________________
> However, when I made clicks on  the map, no marker has appeared, but
> instead an "Error on page" message appearde on the bottom of the map.
> Why did this problem appeared and how can I fix the problem?roblem?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to