insert marker and controls

146 views
Skip to first unread message

snafu4685

unread,
Aug 7, 2010, 6:04:46 PM8/7/10
to Google Maps JavaScript API v3
OK i am new at this. how do i insert controls (map, satellite,
terrain) and marker it seems that i can do one or the other but not
both.

below is the script for the marker how do i add controls?
Thanks for your help.


<title>Google Maps JavaScript API Example</title>
<script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;key=ABQIAAAAphpXnyTseZWEiZEcqMkt6hQQYqv8TOErtbi6mWvR-
GAqbbVH4xQUj00DuxV_FVlPDQB-xpMKXi-Gog"
type="text/javascript"></script>
<script type="text/javascript">

function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(33.814232, -84.625090), 13);
map.setUIToDefault();

var map =GSmallMapControl()





var map = new GMap2(document.getElementById("map_canvas"));
var center = new GLatLng(33.814232, -84.625090);
map.setCenter(center, 13);
GSmallMapControl()
var marker = new GMarker(center, {draggable: false});

GEvent.addListener(marker, "dragstart", function() {
map.closeInfoWindow();
});

GEvent.addListener(marker, "dragend", function() {
marker.openInfoWindowHtml("Just bouncing along...");
});

map.addOverlay(marker);


}
}

</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 500px; height: 300px"></div>




geoco...@gmail.com

unread,
Aug 7, 2010, 7:07:21 PM8/7/10
to Google Maps JavaScript API v3
On Aug 7, 3:04 pm, snafu4685 <thegallery...@gmail.com> wrote:
> OK i am new at this. how do i insert controls (map, satellite,
> terrain) and marker it seems that i can do one or the other but not
> both.
>
> below is the script for the marker how do i add controls?
> Thanks for your help.
>
>  <title>Google Maps JavaScript API Example</title>
>     <script src="http://maps.google.com/maps?
> file=api&amp;v=2&amp;key=ABQIAAAAphpXnyTseZWEiZEcqMkt6hQQYqv8TOErtbi6mWvR-
> GAqbbVH4xQUj00DuxV_FVlPDQB-xpMKXi-Gog"
>             type="text/javascript"></script>

This looks like a v2 map. The v2 group is:
http://groups.google.com/group/google-maps-api/topics?hl=en

For v2 of the API, Mike Williams' tutorial is a must read:
http://econym.org.uk/gmap/

The posting guidelines for that group (and this group) ask for a link
to your map if you want help...


-- Larry

snafu4685

unread,
Aug 8, 2010, 7:43:19 AM8/8/10
to Google Maps JavaScript API v3
Here is the link
http://www.thegallery.us/map/iframe.htm


On Aug 7, 7:07 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:

geoco...@gmail.com

unread,
Aug 8, 2010, 11:40:36 AM8/8/10
to Google Maps JavaScript API v3
On Aug 8, 4:43 am, snafu4685 <thegallery...@gmail.com> wrote:
> Here is the linkhttp://www.thegallery.us/map/iframe.htm

That is a v2 map. As I said in my earlier response, the v2 group is:
http://groups.google.com/group/google-maps-api/topics?hl=en

I see both controls and a marker on that map, so I'm not sure what
your question is. In any case, you should move the discussion to the
v2 group.

-- Larry
Reply all
Reply to author
Forward
0 new messages