google maps on webview

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

google maps on webview

Postby rayman » Thu Jan 14, 2010 2:12 am

Hello,
ive been trying to open up with webview, google map class..
i dont udnerstand why i cant enable there the zoom option, in order to zoom in/out the map.
*ive just tested it with some url of a map with 4 points and a route between them
here is my code:

WebView webview = new WebView(this);
webview.setHorizontalScrollBarEnabled(true);
webview.setVerticalScrollBarEnabled(true);
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setBuiltInZoomControls(true);

setContentView(webview);
webview.loadUrl("http://maps.google.com/maps?f=d&source=s_d&saddr=41.897422,-93.529015&daddr=41.893333,-93.599052+to:41.901127,-93.6091+to:41.891799,-93.619137&ie=UTF8&z=13");

i`am running it, inside an activity, without special layout, just setting the set content view.
ive also tried to fix it in some layout, and the zoom hasnt been enabled also.
it's running fine, just cant enable the zoom's ability.
Iam doing it through my emulator, and havnt tried it on a real phone yet.

any idea?

thanks.

ray.
rayman
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jan 11, 2010 11:26 pm

Top

Postby sephyroth69 » Thu Jan 14, 2010 10:24 am

I'm far from being a map expert but from what i've read, is the getsettings() really necessary?
is " webview.setBuiltInZoomControls(true); " possible?
sephyroth69
Freshman
Freshman
 
Posts: 8
Joined: Tue Jan 12, 2010 11:02 am

Postby rayman » Thu Jan 14, 2010 11:12 am

No it's not, tried that already!
rayman
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jan 11, 2010 11:26 pm

Postby nicholas.hauschild » Fri Jan 15, 2010 2:20 pm

I haven't used WebView yet, and I do not know if this will help you to achieve YOUR final result, but have you tried working with the MapView? The MapView has the method MapView.setBuiltInZoomControls(boolean), and I have gotten that to work perfectly. Although I must mention that you have to do some setup to get Google's Maps to work on your emulator/device.
nicholas.hauschild
Master Developer
Master Developer
 
Posts: 310
Joined: Fri Dec 04, 2009 4:50 am

mapview

Postby rayman » Fri Jan 15, 2010 2:57 pm

yes ive tried to do a mapview, and there it works fine, but i want a "route" between destenations, and it's much more complicated to achive with mapview, then just past a link from google maps.
rayman
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jan 11, 2010 11:26 pm

Any Solution?

Postby rayman » Mon Jan 18, 2010 11:55 pm

Noone could find any solution to this mysterious?
must be a way how to zoom inside while using webview..

Thanks,

ray.
rayman
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jan 11, 2010 11:26 pm

Top

Any Solution?

Postby rayman » Mon Jan 18, 2010 11:59 pm

Noone could find any solution to this mysterious?
must be a way how to zoom inside while using webview..

Thanks,

ray.
rayman
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jan 11, 2010 11:26 pm

Top

Return to Map Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests