Pages: [1]
Print
Author Topic: How to disable map drag  (Read 476 times)
bobrickard
Download
Newbie
*
Posts: 2


« on: June 22, 2011, 12:44:57 PM »

After successfully searching and getting the database results displayed on a map with the corresponding list of locations displayed below the map, I have the following problem. When the web page is viewed on an iPhone (and probably any smart phone, but I have only tested on an iPhone), you cannot drag the page up to see the displayed results, as the finger swipe drags the map within the google map window, not the page. I believe the Google maps API allows disabling drag, but how can I implement that within LiteRadius?  Thanks.
Logged
Support
Administrator
Jr. Member
*****
Posts: 97



« Reply #1 on: June 22, 2011, 01:11:23 PM »

In the script literadius/views/map_assets/js_css/xml_g_maps.js

look for the function:

Code:
/*
// FUNCTION: load
*/
function load() {
if (GBrowserIsCompatible()) {
    geocoder = new GClientGeocoder();
        map = new GMap2(document.getElementById('map'));       
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.addMapType(G_PHYSICAL_MAP);
// disable map dragging
map.disableDragging();
        initMapView();
    }

and add the following as illustrated ubove:

Code:
map.disableDragging();
Logged
bobrickard
Download
Newbie
*
Posts: 2


« Reply #2 on: June 22, 2011, 01:34:23 PM »

Thanks for the prompt reply!

That works as advertised, in that swiping across the map no longer does anything. I naively thought that with map drag disabled, swiping anywhere would move the page. Not so. A swipe within the map is just ignored. That is still better, and will have to do, I suppose. But it would be nice to have an option where the swipe could not only be ignored by the map, but also passed through to iOS so the page could be dragged. Oh well.
Logged
Pages: [1]
Print
Jump to: