Android wevbiew show Google Maps locked until touch pressed - javascript

Using the android webview component for show Google Maps through API v3 it seem all the map "engine" is locked until touch is pressed. I tested the default browser also. If I go to the google maps web site and start move the map touching the screen is there always a point where there is a gray area of the map still not loaded. In standard Desktop browser this "missing" part is loaded instantly but under android webview this part remain unloaded for all the time of touch pression. If I stop touch the screen this missing image is loaded. This is a very bad behaviour mainly because the same problem happen also with javascript code. I need to get the google maps api "center_changed" event on real time but cause this problem the event is not delivered for all the time the touch is pressed (moving the map). The event is delivedered only on touch leave. Someone noted this strange behaviour and know a workaround for enable "real time" interaction through javascript code?
Thank you

Related

Pinch/spread touch zoom — How do I avoid creating a “zoom trap”?

I have a desktop web app (skyviewcafe.com) that I’m trying to make more mobile-friendly. As one step in that process, I’ve taken a star chart and made it touch-draggable, and also made a view of the orbits of the planets both draggable and zoomable with touch gestures.
But here’s an interesting problem that I imagine must have happened to others before: It’s possible to use the default panning and zooming behavior of a mobile web browser to move my web page around until the only thing in view is a component that itself takes over touch gestures using preventDefault.
Once this happens, it’s impossible to zoom back out and bring the whole web page back into view. All pinch/spread zooming is sucked in by my component. For lack of a better term, I’m calling this a “zoom trap”. I’ve tried to search online for any discussion of this problem, but can’t find the right words to match anything.
I came up with an ad hoc solution that’s currently deployed at http://test.skyviewcafe.com. If I’m in a “zoom trap” I can touch the screen with three fingers and a translucent gray panel comes up to block touch gestures from reaching my touch-responsive canvas. Normal default web browser pan and zoom then becomes possible again, and the user can zoom back out. After that, touching with three fingers again clears the gray panel out of the way.
While this solves the problem in a way, it’s not a standard well-known gesture, and it would be hard to provide enough on-screen prompting to make necessary gesture clear.
Ideally I’d like to be able to respond to a standard gesture like a double-tap by zooming out the web page, but as far as I can tell, other than the initial zoom factor when a web page loads, web browser zooming isn’t something a web app can control dynamically.
Has anyone else run into this problem? Are there standard touch gestures for dealing with this? Are there ways in JavaScript that I haven’t discovered yet to dynamically control mobile web browser zooming?

Greasemonkey script: for Google Maps to disable Zoom on Scroll

As a desktop browser user of Google Maps I'd like to switch off the Zooming that occurs every time I use my touch-pad two-finger gesture to scroll up/down.
How do I get hold of the appropriate DOM object handle?
So I can script Greasemonkey (or similar) to set the scrollwheel option to false as shown in this previous answer (which is for developers who use the GoogleMap API on their own sites)
How to disable mouse scroll wheel scaling with Google Maps API

Google Embeded maps won't work with infra-red touch frame

I'm trying to use Google Maps (JS APIv3) in Chrome, in a kiosk mode, intending to use it with and infra-red touch frame. IR touch frame in a HID-mode (emulating not a mouse, but rather a touch device) works perfectly with maps.google.com, allowing to pan map with a finger, but won't allow it on an embedded map.
I assume that Google uses some sort of additional library for touch events, but looking into source code haven't given me any hints.
Anyway, is it possible to enable panning in an embedded google map for a generic touch device?
Thanks in advance!
Well.. even they have document on this control option, they don't seems to provided ways to enable the touch to pan event....
One work around might be to set to user-agent as chrome on Android.

"Focus" and activate Google Map Embed Programmatically

I'm pretty new to the Google Maps API.
I'm building a simple Maps App for our TV platform here at work, the TV uses a custom webkit browser and I've confirmed that the Maps API works well on it.
Currently when you load a simple app like this on our TV (Code is given in below links):
http://markpaul.name/dont-delete/other/sample-maps-app.html
You first need to use the mouse to "click" on the screen to "focus" the map. Only after this, the map embed "activates" and you can use the up, down, left, right keys to navigate the map.
The problem I have is this; on a TV you dont have a mouse so you cant "click" to "focus"!
Is there anyway you can programatically "focus" the Google Map so I can use the arrow keys on the remote (which usually map to the keyboard up, down, left, right keys) to navigate the map?
Thanks in advance,
Mark
UPDATE:
My code can be seen here - http://codepen.io/newbreedofgeek/pen/EaugH
The full screen app in codepen is here - http://codepen.io/newbreedofgeek/full/EaugH
The hosted full screen app (minus autogenerated CodePen markup in full screen codepen view) is here - http://markpaul.name/dont-delete/other/sample-maps-app.html
I checked you source code and my feel is that somewhere the map's position is getting changed. So by triggering the Google map's resize it would fix your problem.
google.maps.event.trigger(map, 'resize');
Add the above code after initializing the Google maps. This would fix the problem.

How does the iPhone Google image search touch-event functionality work?

When I do a Google image search on my iPhone within the Safari mobile browser, it gives me this beautiful interface for flipping through the images. If I swipe left or right, it browses through the images. If I touch and move up or down, I get what appears to be the native Safari scroll function. Can anyone explain how Google does this? I'm only beginning to learn the Safari API for touch events. It seems like either you capture the touch event to attach handlers to swipe left or right or you let Safari handle the touch events natively, in which case you get the beautiful native Safari scrolling. Can anyone explain how Google captures left/right swipe but not scrolling?
There are touch-specific DOM Events. They've implemented a lot of JavaScript logic around them. Read the Safari Web Content Guideline: Handling Events Docs Also checkout out the official spec for Touch Events
A while back, I wrote a quick library to wrap some native-like gestures as HTML events JSGestureRecognizer. I don't really recommend using that library in production, but reading the source should give you a pretty good idea about how google went about listening to native Touch Events and doing complex user interfaces with them.

Categories

Resources