1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    London
    Posts
    393
    Vote Rating
    17
    digeridoopoo will become famous soon enough

      0  

    Default Setting Google map style type

    Setting Google map style type


    Hi,

    I've tried for a few hours now to set the default style of my google map to Terrain before load, and I'm not having much luck. At the moment it display roadmap view, and in the top right I have the options for satellite and terrain, which work when clicked. However, I'd like to set the default to Terrain on load, as this map looks nicer.
    I've tried the below but it didn't work, does anyone have any tips?

    Code:
    Ext.setup({
      tabletStartupScreen: 'images/tablet_startup.png',
      phoneStartupScreen: 'images/phone_startup.png',
      icon: 'images/icon.png',
      glossOnIcon: false,
      onReady: function() 
        {
        map = new Ext.Map({
          title: 'Map',
          getLocation: true,
          mapOptions: {
            zoom: 2,
            mapTypeId : google.maps.MapTypeId.TERRAIN
          },
          listeners: {
            maprender: function(mapC, map) {
    etc.
    I also tried the syntax from this post, but that didn't work either:

    http://www.sencha.com/forum/showthread.php?110071-Google-map-Styled-Maps&

    T
    hanks,

    Digeridoopoo

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Location
    London
    Posts
    393
    Vote Rating
    17
    digeridoopoo will become famous soon enough

      0  

    Default Found it :-)

    Found it :-)


    I worked it out by accident by adding the navigationControl: false code here!

    Code:
    mapOptions: {
            zoom: 2,
    		mapTypeId : google.maps.MapTypeId.TERRAIN,
    		navigationControl: false
          },
          listeners: {
    :-)