1. #1
    Sencha User
    Join Date
    Jan 2013
    Posts
    42
    Vote Rating
    0
    HugoTrigo is on a distinguished road

      0  

    Default Center Map

    Center Map


    Hi, I'm using de Map in Secha Architect but i don't center the map in the specific position.

    I have this code in MapOptions Config:

    center: new google.maps.LatLng(32.842178,-96.774654),
    zoom: 12

    How does not work?

    Best Regards,
    Hugo Trigo

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Posts
    206
    Vote Rating
    8
    allisterf is on a distinguished road

      0  

    Default


    Hi Hugo - you have to use an override. Just adding your map options to the config is not sufficient. Do you know how to do those?
    allister

  3. #3
    Sencha User
    Join Date
    Jan 2013
    Posts
    42
    Vote Rating
    0
    HugoTrigo is on a distinguished road

      0  

    Default


    Hi Allister,


    I'm working on the Architect, realize an override right? Can you give me an example of code to perform this operation?


    Best Regards,
    Hugo Trigo

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Posts
    206
    Vote Rating
    8
    allisterf is on a distinguished road

      1  

    Default


    Start by adding a map into the top level of your view. You can then move it to where you want but create a link to the new place, not actually move it. Add an override to the original map item and add your code into the override. For example my override looks like:

    Code:
    Ext.define('MyApp.view.override.MyMap', {
        override: 'MyApp.view.MyMap',
              config: {
                   
                       mapOptions : {
                   center : new google.maps.LatLng(LAT,LONG),  //your coordinates instead of LAT,LONG
                    zoom : 15,
                    mapTypeId : google.maps.MapTypeId.ROADMAP,
                    navigationControl: true,
                    navigationControlOptions: {
                        style: google.maps.NavigationControlStyle.DEFAULT
                    }
                },
    
    
                listeners: {
                    maprender: function(comp, map) {
                        var marker = new google.maps.Marker({
                            map : map,
                            position : map.center,
                            animation: google.maps.Animation.BOUNCE, //you can also use DROP
                            title : "Your Title"
                        });
                   
                    }
                }
        
        
             
             
         }
        
    });
    Hope that works for you
    Allister

  5. #5
    Sencha User
    Join Date
    Jan 2013
    Posts
    42
    Vote Rating
    0
    HugoTrigo is on a distinguished road

      0  

    Default


    Thanks Allister!

    It works great!

    Best Regards,
    Hugo Trigo

  6. #6
    Sencha User
    Join Date
    Aug 2011
    Posts
    206
    Vote Rating
    8
    allisterf is on a distinguished road

      0  

    Default


    Your welcome!

    To take this a step further, has anyone got a good example of how to use geolocation to then offer a map/direction route from where the user currently is, to where the marker on the map indicates he's trying to get to?

    Allister

  7. #7
    Sencha User
    Join Date
    Jan 2013
    Posts
    42
    Vote Rating
    0
    HugoTrigo is on a distinguished road

      0  

    Default


    I now do not be too hard to do. See the API of Google and just try!


    https://developers.google.com/maps/d...rence?hl=pt-PT # DirectionsRoute


    Best Regards,
    Hugo Trigo

  8. #8
    Sencha User
    Join Date
    Apr 2010
    Posts
    2
    Vote Rating
    0
    mcclung is on a distinguished road

      0  

    Default How did you get the gMaps API loaded?

    How did you get the gMaps API loaded?


    Hi,
    I created a new resource and pointed it to https://maps.googleapis.com/maps/api/js?key={key}&sensor=false
    as well as https://maps.googleapis.com/maps/api/js?sensor=false and always get a response:

    alert("The Google Maps API server rejected your request. The \x27sensor\x27 parameter specified in the request must be set to either \x27true\x27 or \x27false\x27.")

    If I enter the same thing on the browser I get a JavaScript response...

    Thanks for your help.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi