Problem implementing mapTypeIds

20 views
Skip to first unread message

dondmcg

unread,
Jul 28, 2011, 12:07:18 PM7/28/11
to Google Maps JavaScript API v3
I have read throughout the documentation and searched these forums. I
found several posts pertaining to this but when I follow the
instructions I do not get the solution. I am trying to simply add
TERRAIN to the controls of my map
http://staging.nybg.org/science/geographic-area-programs.php

But no matter what I try I still only get the default roadmap and
satellite. Below is my code any ideas?
P.S. I know that you have altered the documentation already regarding
this implementation as there was a typo but I suggest an example would
be clearer. Just my 2 sense.

<code>
var mapmulti = new
google.maps.Map(document.getElementById('mapmulti'), {
zoom: 2,
center: new google.maps.LatLng(40.847265, -73.893876),
mapTypeId: google.maps.MapTypeId.SATELLITE,
//mapTypeControl: true,
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP,
google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.TERRAIN],
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
position: google.maps.ControlPosition.TOP_CENTER
}
});
</code>

William

unread,
Jul 28, 2011, 5:31:52 PM7/28/11
to Google Maps JavaScript API v3
On Jul 29, 2:07 am, dondmcg <d...@mcgrathdesigns.com> wrote:
> I am trying to simply add
> TERRAIN to the controls of my map
> http://staging.nybg.org/science/geographic-area-programs.php
>
> But no matter what I try I still only get the default roadmap and
> satellite.

on your map, when you select the roadmap maptype, then "Terrain" is
available as a tickbox under the "Map".

I think V3.3 is the only current version which still shows Terrain as
separate button.

But I'd expect V3.3 to be retired soon, with the schedule for the next
release due early in August?

...

en4ce

unread,
Jul 29, 2011, 6:01:03 AM7/29/11
to Google Maps JavaScript API v3
i never liked this behavior, best is you do a custom map type
control... there should be a lot of easy to understand tutorials =)
Reply all
Reply to author
Forward
0 new messages