1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    13
    Vote Rating
    0
    keweli is on a distinguished road

      0  

    Default Unanswered: How to use mapOptions?

    Unanswered: How to use mapOptions?


    I am trying to simply show a map with a marker set to the given geolocation. But the mapOptions doesn't seem to work, it just keeps showing some place in America. Am I doing it right?

    Code:
                        {
                            xtype: 'map',
                            title: 'MyMap',
                            height: 202,
                            width: '100%',
                            mapOptions: 'center : new google.maps.LatLng(-37.20097, 145.08719)'
                        }
    Thanks

  2. #2
    Sencha Premium Member bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    199
    Vote Rating
    25
    Answers
    18
    bricemason will become famous soon enough bricemason will become famous soon enough

      0  

    Default


    The map options are an object so this would work:

    Code:
    {
        xtype: 'map',
        title: 'MyMap',
        height: 202,
        width: '100%',
        mapOptions: {
            center : new google.maps.LatLng(-37.20097, 145.08719)
        }
    }
    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.