1. #1
    Sencha User
    Join Date
    Feb 2008
    Posts
    36
    Vote Rating
    0
    yozefff is on a distinguished road

      0  

    Default Sencha Touch 2 Ext.map mapOptions

    Sencha Touch 2 Ext.map mapOptions


    I have an map (Ext.map) placed in my view.

    I wanted to set the mapOptions just as the Map example :

    Code:
                mapOptions : {
                    center : new google.maps.LatLng(37.381592, -122.135672),  //nearby San Fran
                    zoom : 12,
                    mapTypeId : google.maps.MapTypeId.ROADMAP,
                    navigationControl: true,
                    navigationControlOptions: {
                        style: google.maps.NavigationControlStyle.DEFAULT
                    }
                },
    So when I try to fill this in SD for example

    Code:
    {
    center : new google.maps.LatLng(37.381592, -122.135672)
    }
    then SD will output this as

    Code:
    mapOptions: '{\ncenter : new google.maps.LatLng(37.381592, -122.135672)\n}'
    So this means mapOptions will be a string? I don't think this is the right way to go ..

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,240
    Vote Rating
    121
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Set these configurations via an override.

    Designer does not support using variables within configurations you've set in the property grid.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    taher@youvisit.com is on a distinguished road

      0  

    Default


    Can you please elaborate on which functions to override. I have spent the last hour trying to override the constructor and setting the mapOptions but to no avail. Also, can you update any of the config values directly or do you need to set them via functions

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    taher@youvisit.com is on a distinguished road

      0  

    Default


    Nevermind. I did not realize that you can override config values directly in the override.

  5. #5
    Sencha User
    Join Date
    Apr 2012
    Posts
    1
    Vote Rating
    0
    juniorg is on a distinguished road

      0  

    Default problems with map options

    problems with map options


    Hello, i have the same problem with setting map options. how can i set my own lat and lgn?
    this line does not work:

    center : new google.maps.LatLng(37.381592, -122.135672)

    thanks.

  6. #6
    Sencha User
    Join Date
    Jan 2012
    Posts
    1
    Vote Rating
    0
    swisstronic is on a distinguished road

      0  

    Default Use eval

    Use eval


    Hi,

    This is not the best way but it works, use eval javascript fonction.

    {center : eval("new google.maps.LatLng(22,22)"),mapTypeId:google.maps.MapTypeId.SATELLITE,zoom:16}