webOS Nation Forums >  webOS Developers >  webOS Development > New Google Maps for WebOS - native javascript API
New Google Maps for WebOS - native javascript API
  Reply
Like Tree335Likes

 
Thread Tools Display Modes
Old 12/11/2012, 06:50 AM   #1161 (permalink)
Homebrew Developer
 
72ka's Avatar
 
Posts: 477
Pizza again just for information, simple photos viewer is done, you can browse all available photos ....
I think I can leave it in this simple form for this time and have to go to next big task - new external call and search behavior...
Attached Images
File Type: png photos2.PNG (265.4 KB, 53 views) Email Attachment
__________________
HP Pre3, the Google Maps, wInNeR, Gas&Oil, HERE maps for webOS development
72ka is offline   Reply With Quote
Liked by jcmarcos likes this.
Thanked by gizmo21, jcmarcos
Old 12/11/2012, 07:14 AM   #1162 (permalink)
Member
 
Rockbeast's Avatar
 
Posts: 1,230
Quote:
Originally Posted by 72ka View Post
Pizza again just for information, simple photos viewer is done, you can browse all available photos ....
I think I can leave it in this simple form for this time and have to go to next big task - new external call and search behavior...
Cool...cool...but, do take some time out for the holidays, will you?

EDIT: Since the entire month of January is named in your honor, I'm ok with you taking the whole month...plus Christmas Day...unless you are celebrating Chanukah, then you should already be celebrating! Kwanza? Look, you can only take SO much time off!
__________________
Sent from my slowly diminishing intellect

I'm just a soul who's intentions are good...oh Lord, please don't let me be misunderstood!


Last edited by Rockbeast; 12/11/2012 at 10:29 AM.
Rockbeast is offline   Reply With Quote
Old 12/11/2012, 07:56 AM   #1163 (permalink)
Homebrew Developer
 
72ka's Avatar
 
Posts: 477
Hi,

in short look into Bing maps code, the default Bing maps accepts these parameters:

Code:
query: The query used to search for places or location.
 address: The address location used to center the map view.
 location:
 lat: The latitude of the location used to center the map view.
 lng: The longitde of the location used to center the map view.
 route:
 startAddress: The address of the starting waypoint for a route.
 endAddress: The address of the ending waypoint for a route.
 zoom: The zoom level of the map view.
 mapType: The map type of the map view.  Valid map types are aerial, auto, birdseye, collinsBart, mercator, ordnanceSurvey and road.
 target: mapto or maploc with address in URL encoded format, e.g. mapto://303%20Second%20Street%2C%20San%20Francisco
OK... the best and most compatible way is to implement all of these parameters exactly the same....
Correct?
__________________
HP Pre3, the Google Maps, wInNeR, Gas&Oil, HERE maps for webOS development
72ka is offline   Reply With Quote
Old 12/11/2012, 10:09 AM   #1164 (permalink)
pivotCE Developer
 
Posts: 2,115
Quote:
Originally Posted by 72ka View Post
Hi,

in short look into Bing maps code, the default Bing maps accepts these parameters:
...

OK... the best and most compatible way is to implement all of these parameters exactly the same....
Correct?
Cross-App Launching parameters:
Sounds good, even if it seems a bit too much having zoom and maptype. But if it's possible.
But take a break from 20th Dec to at least 3rd Jan

URL-Type registering:
It seems there are only Luna getter methods for URL type handling:
https://github.com/openwebos/luna-sy...ster/README.md

com.palm.applicationManager/getHandlerForExtension
com.palm.applicationManager/getHandlerForMimeType
com.palm.applicationManager/getHandlerForMimeTypeByVerb
com.palm.applicationManager/getHandlerForUrl
com.palm.applicationManager/getHandlerForUrlByVerb
com.palm.applicationManager/getResourceInfo

com.palm.applicationManager/listAllHandlersForMime
com.palm.applicationManager/listAllHandlersForMimeByVerb
com.palm.applicationManager/listAllHandlersForMultipleMime
com.palm.applicationManager/listAllHandlersForMultipleUrlPattern
com.palm.applicationManager/listAllHandlersForUrl
com.palm.applicationManager/listAllHandlersForUrlByVerb
com.palm.applicationManager/listAllHandlersForUrlPattern

Only for Filetypes like .mp3 or .avi there are setter methods, as it seems:

com.palm.applicationManager/addRedirectHandler
com.palm.applicationManager/addResourceHandler

Resource handling for Filetypes:
L\'Haut-Parleur WebOS: register your own app as file handler
L\'Haut-Parleur An app to register another app for a certain file type…
Which is done here e.g.
http://mplayer-webos.googlecode.com/...ts/handling.sh
__________________
Patch Enhancing vCard Export -|- Your own cloud with Zarafa (EAS sync) -|-
Tasks-app of 2.x on 3.x incl.EAS sync -|- SYM key in Enyo on phones -|- My hidden webOS Tips and Tricks - like it ?

Last edited by gizmo21; 12/11/2012 at 10:20 AM.
gizmo21 is offline   Reply With Quote
Liked by 72ka likes this.
Thanked By: 72ka
Old 12/11/2012, 10:18 AM   #1165 (permalink)
pivotCE Developer
 
Posts: 2,115
oops just found one source on Treo8:
*register app޸ļij - webOS/ - Ѱ(Pre,Pixi,webOS) - Powered by Discuz!

Could this do the trick registering the mapto/maploc-URLs, which together with cross app launch parameter would bring full map ccompatibility?

Code:
MainAssistant.prototype.registerURL = function(app, url) {
        this.controller.serviceRequest("palm://com.palm.applicationManager/", {
                method: 'addResourceHandler',
                parameters: {
                        "appId": app,
                        "url": url
                },
                onSuccess: function() {
                        Mojo.Log.error("Success");
                }.bind(this),
                onError: function(e) {
                        Mojo.Log.error("Error %j",e);
                }.bind(this),
                onFailure: function(e) {
                        Mojo.Log.error("Failure %j",e);
                }.bind(this)
        });
};
Perhaps i'll try this on command line (well now already did ):

/usr/bin/luna-send -n 1 palm://com.palm.applicationManager/listAllHandlersForUrl '{"url":"mapto:"}'
It seems these values for mapto are already correct for your app (perhaps the systemdefault could be changed):
Quote:
{ "subscribed": false, "url": "mapto:", "returnValue": true, "redirectHandlers": { "activeHandler": { "url": "^mapto:", "appId": "cz.72ka.googlemaps", "index": 15, "schemeForm": true, "appName": "Google Maps" }, "alternates": [ { "url": "^mapto:", "appId": "org.webosinternals.navit-maps", "index": 16, "schemeForm": true, "appName": "Navit Maps" }, { "url": "^mapto:", "appId": "com.palm.app.maps", "index": 17, "tag": "system-default", "schemeForm": true, "appName": "Karten" }, { "url": "^mapto:", "appId": "com.palm.app.googlemaps", "index": 18, "schemeForm": true, "appName": "Google Maps" } ] } }
/usr/bin/luna-send -n 1 palm://com.palm.applicationManager/listAllHandlersForUrl '{"url":"maploc:"}'
Here it seems these values aren't correct, as active handler is still the old palm.app.maps:
Quote:
{ "subscribed": false, "url": "maploc:", "returnValue": true, "redirectHandlers": { "activeHandler": { "url": "^maploc:", "appId": "com.palm.app.maps", "index": 11, "tag": "system-default", "schemeForm": true, "appName": "Karten" }, "alternates": [ { "url": "^maploc:", "appId": "org.webosinternals.navit-maps", "index": 12, "schemeForm": true, "appName": "Navit Maps" }, { "url": "^maploc:", "appId": "com.palm.app.googlemaps", "index": 13, "schemeForm": true, "appName": "Google Maps" }, { "url": "^maploc:", "appId": "cz.72ka.googlemaps", "index": 14, "schemeForm": true, "appName": "Google Maps" } ] }
Perhaps these luna-sends can be extended with parameters for "activeHandler" or tag:system-default

/usr/bin/luna-send -n 1 palm://com.palm.applicationManager/addResourceHandler '{"appId":"cz.72ka.googlemaps", "url":"mapto:"}'
/usr/bin/luna-send -n 1 palm://com.palm.applicationManager/addResourceHandler '{"appId":"cz.72ka.googlemaps", "url":"maploc:"}'


If all goes wrong i could remove it again
/usr/bin/luna-send -n 1 palm://com.palm.applicationManager/removeHandlersForAppId '{"appId":"cz.72ka.googlemaps"}'



[Updated several times ]

Last edited by gizmo21; 08/19/2013 at 02:00 AM. Reason: [Updated several times :D]
gizmo21 is offline   Reply With Quote
Liked by 72ka likes this.
Thanked By: 72ka
Old 12/11/2012, 10:21 AM   #1166 (permalink)
Member
 
jcmarcos's Avatar
 
Posts: 877
(/me enjoys and feels lost at the same time) ;-)
__________________
Pre 3 on GSM Jazztel: UberKernel, Muffle logging & friends, Mode Switcher, Advanced System Menus & Prefs, and then some more.

Proudly choosing the loser side since 1982: Commodore VIC-20, C-64, Amiga 1000 & 3000, bPlan Pegasos & MorphOS, Psion Revo, Palm Pre...
jcmarcos is offline   Reply With Quote
Old 12/11/2012, 02:06 PM   #1167 (permalink)
Homebrew Developer
 
72ka's Avatar
 
Posts: 477
To gizmo21: Thank you, this is A LOT of new informations, and all on one place.... great! Very helpfull!
__________________
HP Pre3, the Google Maps, wInNeR, Gas&Oil, HERE maps for webOS development
72ka is offline   Reply With Quote
Old 12/11/2012, 03:13 PM   #1168 (permalink)
pivotCE Developer
 
Posts: 2,115
well hopefully helpful at all
gizmo21 is offline   Reply With Quote
Old 12/12/2012, 11:46 AM   #1169 (permalink)
Member
 
Posts: 1
Just found this great App, Thanks!

It would be nice to have it START even if NO internet connection, just like Google maps on Androids, simply with the last Maps when last exited. I have no data plan on my Pixi+, but like to drive around town and seeing the hills around me in Google Terrain. When I forget to start it before leaving my home I have no maps.

When internet connection it works great.
Tschanz is offline   Reply With Quote
Old 12/12/2012, 06:27 PM   #1170 (permalink)
pivotCE Developer
 
Posts: 2,115
as i saw in phx-map thread that they suffer from same touchui desaster in webkit webviews on 2.2.x devices, i thought perhaps it is just a parameter to be set in webos file:
/usr/palm/frameworks/webview/submission/23.11/javascript/widget_webview.js

on webos 2.1 this one was still on framework 23.1 instead of 23.11, perhaps one could find differences.


or perhaps fix by parameter set in app, like on android:
javascript - Disable touch event on document in Firefox 4 for Android - Stack Overflow
gizmo21 is offline   Reply With Quote
Liked by jcmarcos likes this.
Old 12/13/2012, 01:42 AM   #1171 (permalink)
Member
 
jcmarcos's Avatar
 
Posts: 877
Quote:
Originally Posted by gizmo21 View Post
as i saw in phx-map thread that they suffer from same touchui desaster in webkit webviews on 2.2.x devices
That's interesting. This morning, I saw the announcement of a new map API from Google, but perhaps Jan is very aware of it since ages... That "vector-based maps that load quickly, allowing users to easily navigate 2D and 3D views, rotating and tilting the map with simple gestures" has me intrigued. Also, the part about registering for use, because until now, Google Maps allowed completely anonyouns usage.
__________________
Pre 3 on GSM Jazztel: UberKernel, Muffle logging & friends, Mode Switcher, Advanced System Menus & Prefs, and then some more.

Proudly choosing the loser side since 1982: Commodore VIC-20, C-64, Amiga 1000 & 3000, bPlan Pegasos & MorphOS, Psion Revo, Palm Pre...
jcmarcos is offline   Reply With Quote
Old 12/13/2012, 06:40 AM   #1172 (permalink)
Homebrew Developer
 
72ka's Avatar
 
Posts: 477
Quote:
Originally Posted by gizmo21 View Post
as i saw in phx-map thread that they suffer from same touchui desaster in webkit webviews on 2.2.x devices, i thought perhaps it is just a parameter to be set in webos file:
/usr/palm/frameworks/webview/submission/23.11/javascript/widget_webview.js

on webos 2.1 this one was still on framework 23.1 instead of 23.11, perhaps one could find differences.


or perhaps fix by parameter set in app, like on android:
javascript - Disable touch event on document in Firefox 4 for Android - Stack Overflow
Hi, this is sadly a far complicated. First, my Google maps doesnt use webview at all, it is a native API rendering into the page body. Second, I can disable listening for touch events and can do more... but the issue is that webkit binaries are compiled with touch enabled or similar switch parameter, but mojo framweork doesnt fire the touch events at all. Every mobile-optimized web or app (e.g. Google Maps API) detects the touch device using

Code:
function isTouchDevice() {
    return "ontouchstart" in window;
}
where the webOS 2.2.x webkit returns TRUE (that's why the API loads the touch-enabled version of API).. and this is NOT TRUE webOS 2.2.x fires only mousevents...
__________________
HP Pre3, the Google Maps, wInNeR, Gas&Oil, HERE maps for webOS development
72ka is offline   Reply With Quote
Old 12/13/2012, 06:43 AM   #1173 (permalink)
Homebrew Developer
 
72ka's Avatar
 
Posts: 477
Quote:
Originally Posted by jcmarcos View Post
That's interesting. This morning, I saw the announcement of a new map API from Google
Sounds very good, but only for iOS developers/users... their SDK is only for iOS. We have only the Javascript API, and unsupported....
__________________
HP Pre3, the Google Maps, wInNeR, Gas&Oil, HERE maps for webOS development
72ka is offline   Reply With Quote
Old 12/13/2012, 06:53 AM   #1174 (permalink)
Homebrew Developer
 
72ka's Avatar
 
Posts: 477
Quote:
Originally Posted by Tschanz View Post
Just found this great App, Thanks!

It would be nice to have it START even if NO internet connection, just like Google maps on Androids, simply with the last Maps when last exited. I have no data plan on my Pixi+, but like to drive around town and seeing the hills around me in Google Terrain. When I forget to start it before leaving my home I have no maps.

When internet connection it works great.
Hi, bad news for you, although the last tiles are in cache, the whole API not (no legal way to cache it), the API is essential for the basic operations like displaying the map, paning, etc.
Maps on Android are based on different closed base.. not on the JS API, android maps are the leader in google maps evolution and they are every time one step ahead.
__________________
HP Pre3, the Google Maps, wInNeR, Gas&Oil, HERE maps for webOS development
72ka is offline   Reply With Quote
Old 12/13/2012, 09:22 AM   #1175 (permalink)
Homebrew Developer
 
72ka's Avatar
 
Posts: 477
Anyway, back to the reality (no vector, offline and smooth google maps on webOS)...

Two days of work on the app brings the first results:
  1. I included all the same cross-app parameters as Bing maps, using the new functions, hope more robust and flexible
  2. New, and awesome universal search.. like "Just type anything" submitted by Enter, if the result counts only one place (usually an address or place name), the standard pin will be placed, if the result contains more than one place (usually nearby places), then will be placed the iOS style pins like before. Google says about the search ability: The Places Search Box allows your users to perform text based geographic searches such as "Pizza in New York" or "shoe stores near robson street". -i agree, it works like a charm ("lidl near waldkirchen" - on the screenshot, Lidl markets near very nice town in the district of Freyung-Grafenau in Germany)
ToDo: handling an URis etc...., directly show the place from cross-app launch, re-include the coordinates support to new search bar

The ToDo is still long...
Attached Images
File Type: png LidlWaldkirchen.PNG (185.4 KB, 27 views) Email Attachment
__________________
HP Pre3, the Google Maps, wInNeR, Gas&Oil, HERE maps for webOS development

Last edited by 72ka; 12/13/2012 at 09:37 AM.
72ka is offline   Reply With Quote
Liked by jcmarcos and T-Pad like this.
Thanked by jcmarcos, T-Pad
Old 12/13/2012, 10:57 AM   #1176 (permalink)
Member
 
Posts: 88
Quote:
Originally Posted by 72ka View Post
Anyway, back to the reality (no vector, offline and smooth google maps on webOS)...

Two days of work on the app brings the first results:
  1. I included all the same cross-app parameters as Bing maps, using the new functions, hope more robust and flexible
  2. New, and awesome universal search.. like "Just type anything" submitted by Enter, if the result counts only one place (usually an address or place name), the standard pin will be placed, if the result contains more than one place (usually nearby places), then will be placed the iOS style pins like before. Google says about the search ability: The Places Search Box allows your users to perform text based geographic searches such as "Pizza in New York" or "shoe stores near robson street". -i agree, it works like a charm ("lidl near waldkirchen" - on the screenshot, Lidl markets near very nice town in the district of Freyung-Grafenau in Germany)
ToDo: handling an URis etc...., directly show the place from cross-app launch, re-include the coordinates support to new search bar

The ToDo is still long...
Yes God of Maps, we follow thee God of Maps.

Damn this guy is good.
kkalogia is offline   Reply With Quote
Old 12/14/2012, 10:59 AM   #1177 (permalink)
Member
 
Posts: 270
Quote:
Originally Posted by 72ka View Post
[*]I included all the same cross-app parameters as Bing maps, using the new functions, hope more robust and flexible
Does that mean we dont need patches like for klickTel app anymore?
michel_ng is offline   Reply With Quote
Old 12/19/2012, 07:09 AM   #1178 (permalink)
Homebrew Developer
 
72ka's Avatar
 
Posts: 477
Hi, Github stopped the downloads, more here:

https://github.com/blog/1302-goodbye-uploads

I have to find some other place where to put the packages as backup storage...

Anyway, the 0.2.9 has been released. I decided to release it, because it contains big changes. And I can continue in ToDos and wait for feedback, Im expecting a many bugs....

So, this is probably the latest 2012 release, enjoy it, try the new search behavior, dont hesitate to write anything to the search field, try to get some photos from your favorite places and I hope that you will never see "undefined" in search field. Enjoy the other minor improvements, no more overflowing texts and rating stars in infobubles etc...

Despite of dying webOS, Im still active and have some very nice new features in my mind, what I want to include next year... be surprised...
__________________
HP Pre3, the Google Maps, wInNeR, Gas&Oil, HERE maps for webOS development

Last edited by 72ka; 12/19/2012 at 07:20 AM.
72ka is offline   Reply With Quote
Liked by gizmo21, jcmarcos and er dp like this.
Thanked by er dp, jcmarcos, T-Pad
Old 12/19/2012, 07:48 AM   #1179 (permalink)
Member
 
jcmarcos's Avatar
 
Posts: 877
Quote:
Originally Posted by 72ka View Post
Hi, Github stopped the downloads. I have to find some other place where to put the packages as backup storage.
Oh, what an inconvenience... I guess they decided that because of misuse, and so everyone that was NOT misusing it suffers from that. Doh.

Quote:
the 0.2.9 has been released. I decided to release it, because it contains big changes.
GRRRREAT! Will try it ASAP. By the way, I can't find a "changes.txt" file, to see your latest achievements...

Quote:
And I can continue in ToDos and wait for feedback, Im expecting a many bugs....
Please rest a bit during holidays! Thankyou very much again for all your efforts!
__________________
Pre 3 on GSM Jazztel: UberKernel, Muffle logging & friends, Mode Switcher, Advanced System Menus & Prefs, and then some more.

Proudly choosing the loser side since 1982: Commodore VIC-20, C-64, Amiga 1000 & 3000, bPlan Pegasos & MorphOS, Psion Revo, Palm Pre...
jcmarcos is offline   Reply With Quote
Old 12/19/2012, 10:53 AM   #1180 (permalink)
pivotCE Developer
 
Posts: 2,115
ah well i know there a bunch of open feature requests by myself. But before i forget this one again, i'll add another one:

* can we get the route direction list sendable via mail/sms/clipboard (like the contacts in info markers)? Is usefull for someone asking for the way (transit options...) only having a dumbphone or not much network coverage atm (or just to put it on your next party invitation e-mail). Ah well you decide if it is worth doing.

Or is it against the google terms?


Ah and a long time request that is not on the first postings "to do"-list: route/directions in map view -> jump to end/beginning
New Google Maps for WebOS - native javascript API and New Google Maps for WebOS - native javascript API
__________________
Patch Enhancing vCard Export -|- Your own cloud with Zarafa (EAS sync) -|-
Tasks-app of 2.x on 3.x incl.EAS sync -|- SYM key in Enyo on phones -|- My hidden webOS Tips and Tricks - like it ?

Last edited by gizmo21; 12/19/2012 at 11:08 AM.
gizmo21 is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0