Results 1 to 4 of 4

Thread: Markers and Google maps

  1. #1
    Ext User
    Join Date
    Jun 2010
    Posts
    18
    Vote Rating
    0
      0  

    Default Markers and Google maps

    Can someone point me in the right direction, I can't get any markers to show, I've tried thousands of different ways. Please help.
    PHP Code:

    var myLatlng = new google.maps.LatLng(lat,lng);
            
            var 
    marker = new google.maps.Marker({
                
    positionmyLatlng,
                
    title:"Hello world"
            
    });
            
            var 
    myOptions = {
              
    zoom13,
              
    centermyLatlng,
              
    mapTypeIdgoogle.maps.MapTypeId.ROADMAP
            
    }        
            
            
            var 
    map = new Ext.Map(
            {
                
    fullscreen:true,
                
    mapOptionsmyOptions
            
    });
            
              
    marker.setMap(map);
            
            var 
    pnl = new Ext.Panel({
                
    fullscreentrue,
                
    items: [map]
            }); 

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,187
    Vote Rating
    1000
      0  

    Default

    There's sample code for this in the example, eg:

    Code:
    Ext.setup({
        tabletStartupScreen: 'tablet_startup.png',
        phoneStartupScreen: 'phone_startup.png',
        icon: 'icon.png',
        glossOnIcon: false,
        onReady: function() {
            var toolbar = new Ext.Toolbar({
                dock: 'top',
                xtype: 'toolbar',
                title: 'Map'
            });
            
            var position = new google.maps.LatLng(37.44885,-122.158592);
            
            var mapdemo = new Ext.Map({
                center: position
            });
            
            new Ext.Panel({
                fullscreen: true,
                dockedItems: [toolbar],
                items: [mapdemo]
            });
            
            // The following is accomplished with the Google Map API
            
            var infowindow = new google.maps.InfoWindow({
                content: 'Ext JS'
            })
            
            /*
            var marker = new google.maps.Marker({
                 position: position,
                 map: mapdemo.map
            });
            */
            
            var myMarker = new google.maps.Marker({
                position: new google.maps.LatLng(30.44885,-111.158592),
                map: mapdemo.map
            });
        }
    });
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User
    Join Date
    Mar 2008
    Posts
    50
    Vote Rating
    0
      0  

    Default

    hello

    replace in ext-touch-debug.js at line 15793 to this
    Code:
    Ext.applyIf(this.mapOptions, {
                center: data.center,
                zoom: data.zoom,
                mapTypeId: data.mapTypeId
            });
    and find the same compressed stuff in ext-touch.js

    regards

  4. #4
    Ext User
    Join Date
    Jun 2010
    Posts
    18
    Vote Rating
    0
      0  

    Talking

    Quote Originally Posted by evant View Post
    There's sample code for this in the example, eg:

    Code:
    Ext.setup({
        tabletStartupScreen: 'tablet_startup.png',
        phoneStartupScreen: 'phone_startup.png',
        icon: 'icon.png',
        glossOnIcon: false,
        onReady: function() {
            var toolbar = new Ext.Toolbar({
                dock: 'top',
                xtype: 'toolbar',
                title: 'Map'
            });
            
            var position = new google.maps.LatLng(37.44885,-122.158592);
            
            var mapdemo = new Ext.Map({
                center: position
            });
            
            new Ext.Panel({
                fullscreen: true,
                dockedItems: [toolbar],
                items: [mapdemo]
            });
            
            // The following is accomplished with the Google Map API
            
            var infowindow = new google.maps.InfoWindow({
                content: 'Ext JS'
            })
            
            /*
            var marker = new google.maps.Marker({
                 position: position,
                 map: mapdemo.map
            });
            */
            
            var myMarker = new google.maps.Marker({
                position: new google.maps.LatLng(30.44885,-111.158592),
                map: mapdemo.map
            });
        }
    });
    Cheers for that, I had missed an object reference. all working now.

Similar Threads

  1. Grid, Google Maps and Markers
    By mbravo in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 21 Sep 2011, 7:21 AM
  2. Google Maps in tabs?
    By JoomlaMan in forum Ext 2.x: Help & Discussion
    Replies: 12
    Last Post: 11 May 2009, 1:50 PM
  3. dialogbox and google maps
    By rizla in forum Ext GWT: Help & Discussion (1.x)
    Replies: 10
    Last Post: 10 Dec 2008, 9:43 AM
  4. Forms and Google maps
    By pdchapin in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 14 Aug 2008, 11:28 AM
  5. [Desktop 2.0] Live-Maps / Google-Maps Module v0.1
    By franckxx in forum Community Discussion
    Replies: 10
    Last Post: 22 Mar 2008, 1:00 AM

Posting Permissions

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