Results 1 to 4 of 4

Thread: How do I set the center coordinates of a map?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Aug 2012
    Vote Rating

    Default Answered: How do I set the center coordinates of a map?

    xtype: 'map',
    flex: 1,
    mapOptions: {
    zoomControl: false,
    panControl: false,
    rotateControl: false,
    streetViewControl: false,
    mapTypeControl: false,
    zoom: 13

    Hi all,

    I got a map to show up in the container that I want, but I don't know how to show the map that I want. I don't mind just hard coding the coordinating... but later on, ideally use coordinates from a model.

    Let's assume, Lat and Long are X and Y. How would I tell the map or mapOptions what location I want it to show me?

    I have tried a few things, including:

    1. Adding center to mapOptions..
    center : new google.maps.LatLng(X, Y)

    2. Adding 'LatLng' or 'latitute' and 'longitude' attibutes to map and mapOptions... but im just "hoping it works" rather than have a specific strategy with it.




  2. This works for me:

    new Ext.Map({
        fullscreen : true,
        mapOptions : {
            zoomControl       : false,
            panControl        : false,
            rotateControl     : false,
            streetViewControl : false,
            mapTypeControl    : false,
            zoom              : 13,
            center            : new google.maps.LatLng(38.62452, -90.18514)
    YOu have to be careful of using namespaces in properties like config objects as the Google API must be loaded before that class is defined.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts