Street View problem

Tutorials that use the MapActivity. Many using GPS functionality.

Street View problem

Postby myjob_peter » Wed Sep 10, 2008 2:34 pm

Hi, all.

In the android emulator,these are a Maps application on in ,In can show the street view


but i don't know which function can do this,can you give me some information,if have a sample demo it will better.
thanks.Image
myjob_peter
Freshman
Freshman
 
Posts: 6
Joined: Wed Sep 10, 2008 1:30 pm

Top

Postby plusminus » Wed Sep 10, 2008 4:05 pm

Hello peter ,

on your MapView there is the following method:

public void setStreetView(boolean on)
Control whether Street View availability (blue outlines) is shown on the map. This is incompatible with Traffic indicators, so they will be deactivated if necessary. Street View availability can be drawn over map tiles or over satellite tiles; however, they are optimized for map tiles.
Parameters
on If true, turn street view availability on. If false, turn them off.


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby myjob_peter » Wed Sep 10, 2008 5:26 pm

hi, plusminus.

thank you for you reply.

now, my problem is that i don know how to get a current location street view to show in the screen.

such as,when i click the emulator screen, how can i get the Latitude and Longitude which point i click down and
how can i show the current location display as street view.(Of course ,this area can find street view )

i am a chinese, i am no good in english, so may be i hasn't describe my mind clearly.hope you can understand


thank for you help!
myjob_peter
Freshman
Freshman
 
Posts: 6
Joined: Wed Sep 10, 2008 1:30 pm

Postby plusminus » Wed Sep 10, 2008 6:22 pm

Hello Peter,

MapView provides a bunch of useful methods, like:
public void setOnTouchListener(View.OnTouchListener l)
Register a callback to be invoked when a touch event is sent to this view.
Parameters
l the touch listener to attach to this view

and
public Projection getProjection()
Get a projection for converting between screen-pixel coordinates and latitude/longitude coordinates.
Returns

* The Projection of the map in its current state. You should not hold on to this object for more than one draw, since the projection of the map could change.


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby linkmaster_6 » Wed Oct 29, 2008 8:49 pm

could someone please show me the code he used to get the street view to show the street. thank you :)
linkmaster_6
Experienced Developer
Experienced Developer
 
Posts: 51
Joined: Thu Oct 16, 2008 8:52 pm

Postby myjob_peter » Mon Nov 03, 2008 4:56 pm

Hi,guy.hope can help you

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. GeoPoint point = this.getProjection().fromPixels((int) x, (int) y);
  2.  
  3. uri = "google.streetview:cbll=" + point.getLatitudeE6() / 1E6 + ","
  4.  
  5.                                         + point.getLongitudeE6() / 1E6        
  6.  
  7.                                         + "&cbp=1,45,,45,1.0&mz=5.0";
  8.  
  9. Intent intent = new Intent();
  10.  
  11. intent.setData(Uri.parse(uri));
  12.  
  13. intent.setAction("android.intent.action.VIEW");
  14.  
  15. getContext().startActivity(intent);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
myjob_peter
Freshman
Freshman
 
Posts: 6
Joined: Wed Sep 10, 2008 1:30 pm

Top

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests