Have a look at the sample code here:
http://code.google.com/apis/maps/documentation/javascript/maptypes.html#StyledMaps
Your code would look something like:
----------
var noTransitStationsStyle = [
{
featureType: 'transit.station',
elementType: 'all',
stylers: [
{ visibility: 'off' }
]
}
];
var mapOptions = {
zoom: 15,
center: swiss
};
var map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
var mapType = new google.maps.StyledMapType(noTransitStationsStyle, { name:
'No Stations' });
map.mapTypes.set('nostations', mapType);
map.setMapTypeId('nostations');
On Sat, Oct 9, 2010 at 12:55 AM, pinkcow <[email protected]> wrote:
> i would like to hide all transit stations and thought it should work
> something like this:
>
> var myOptions = {
> zoom: 15,
> center: swiss,
> mapTypeId: google.maps.MapTypeId.ROADMAP,
> //StyledMapType StyledMapTypeOptions MapTypeStyle
> MapTypeStyleFeatureType
> mapType: { style: { featureType: ['transit.station',
> 'visibility: hidden']} }
> };
> map = new google.maps.Map(document.getElementById("map_canvas"),
> myOptions);
>
> i've probably got the syntax wrong, can some please help?
>
> --
> 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]<google-maps-js-api-v3%[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.