<script src="http://maps.google.com/maps?
file=api&v=2&key=abcdefg&sensor=true_or_false" type="text/
javascript"></script>
<script type="text/javascript">
function initialize(lat,long,img,hotelname,address,contact) {
if (GBrowserIsCompatible()) {
var hotelDesc="<img src=\"./includes/"+img+"\" height=\"40\" width=
\"40\"/></br>"+hotelname+"</br>"+ address+" ";
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(lat, long), 13);
map.addControl(new GMapTypeControl());
map.addControl(new GLargeMapControl3D());
var point = new GLatLng(lat,long);
map.addOverlay(createInfoMarker(point,hotelDesc));
}
}
function createInfoMarker(point, hotelDesc) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(hotelDesc);
}
);
return marker;
}
</script>
On May 27, 1:51 pm, Abhijit <[email protected]> wrote:
> hi all..
>
> I am having a problem placing a basic marker on gmaps API
> heres the code i am using....
>
> function load() {
> if (GBrowserIsCompatible()) {
> var map = new GMap2(document.getElementById("map"));
> map.addControl(new GSmallMapControl());
> map.addControl(new GMapTypeControl());
> map.setCenter(new GLatLng(18.945824, 72.834088), 16);
>
> function createMarker(point) {
> var marker = new GMarker(point);
> GEvent.addListener(marker, "click", function() {
> marker.openInfoWindowHtml("<b>HELLO</b>");
> });
> return marker;
> }
>
> var point = new GLatLng(18.945824, 72.834088);
> var marker = createMarker(point);
> map.addOverlay(marker);
>
> }}
>
> it refuses to even load the gmaps API..
>
> You can see the output athttp://nestwelltech.com/Gmaps/shawn_test.html
>
> Cheers
> Abhijit...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---