Results 1 to 2 of 2

Thread: Prevent scrolling when interacting with Google Maps

  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    5
    Vote Rating
    0
      0  

    Default Unanswered: Prevent scrolling when interacting with Google Maps

    I migrated this app from JQuery Mobile, and I used the Google API to make a Google map. I am aware Sencha has a map object, but I have already coded everything into the current map I have, and am not sure how to do so in the map element.

    Moving on, when I touch the current map and move stuff around, it scrolls the whole page. How can I prevent the whole screen from scrolling vertically when I click on a particular DIV? Is it possible?

    EDIT: I have a form on this page as well, so I need the screen to scroll. I just want to stop the scroll event when I click anywhere in the DIV that contains my map.

    Code:
            var locationPanel = Ext.create("Ext.form.Panel", {
                title: 'Location',
                iconCls: 'info',
                xtype: 'formpanel',
                layout: 'vbox',
    
    
                items: [
                    {
                        xtype: 'fieldset',
                        title: 'Geolocation',
                        items: [
                            {
                                xtype: 'textfield',
                                label: 'Address',
                                id: 'address',
                                listeners: {
                                    blur: function(){codeAddress('latitude', 'longitude', true)}
                                }
                            },
                            {
                                xtype: 'textfield',
                                label: 'Latitude',
                                id: 'latitude',
                                readOnly: true
                            },
                            {
                                xtype: 'textfield',
                                label: 'Longitude',
                                id: 'longitude',
                                readOnly: true
                            }
                        ]
                    },
                    {
                        html:     [
                            '<br/><center><div id="map_canvas" style="border:1px solid black;width: 90%; height: 200px"></div></center><br/>'
                        ]
                    }
                ],
                listeners: {
                    activate: function() {
                      if(firstLoad)
                      {
                        getCoords();
                        firstLoad = false;
                      }
                    }
                }
            });

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,326
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    I would use Ext.Map to do it proper. I wouldn't mix more than one framework, a lot to download.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

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
  •