Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

street view & satilite view is not working

 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is my main class

this is working fine.i have added a button to change the view.there are two buttom to change the street view and satilite view.But it is not working.???
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compare lines 173 and 176.
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the error wit h lines 173 and 176 ?
it is trigger only button clicks.
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do they actually do that? Both of them?
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have change the code.still same.


 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you ascertained that those "if" conditions are triggered? In other words, do the mapView.set... methods get executed?
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to change the map view after load it into phone.normally google map load normal map.i need to change the type of map after clicking the button.
So how it should be change?
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have change the code.Still same.

 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:Have you ascertained that those "if" conditions are triggered? In other words, do the mapView.set... methods get executed?

Does that mean the answer to this question is "yes" or "no"?
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
It should be called,because have change them inside the onclick method.Then button clicks it must be called.

Anyway I have change the code as below.Same reqult.


 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didn't ask whether it *should* be called; obviously you think that it should. I asked if it *is* getting called. That's what matters, and that's what you need to find out.
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried with debugging.But never gones to that method.I don't know why ?
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it called for the copyrights button? If so, what's the difference between that button and the other two buttons?
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.copyrights button working.So do i have to call separate activities for each street & satalite views ?
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Separate activities? No. But you will have to register the onClickListener with all buttons for which it should be called.
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Tim.It is working fine.Anyway When i moves with phone The pointer doesn't move.I have to rstart the programm.What is the error with that ?
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you expect to happen? It's not like the onLocationChanged method causes anything to happen.
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to change the poiter with the current changes.Example it i travelling in a vehivle pointer must be change with the location changes.
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you need to tell the MapView to update itself somehow.
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a built in application in my phone which changes the pointer when i move with phone.

anyway can't we do this using this code.

locationManager.requestLocationUpdates(bestprovider,5000, 0.2f, this);
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyway can't we do this using this code.

Why not? I sounded like that's what you wanted to do.
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I change the code as below.


So i reduce the time different.but still it is not update the pointer when i moves in a vehicle .
Where is the error ?
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:Sounds like you need to tell the MapView to update itself somehow.
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So that means i have to repeat calling below code for location changes.



Is it ok to do all above code in onLocationChanged method.I think it is better .because it automatically calls that method when location chnages happen.isn't it ?
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have change the code adding while loop.


But the problem is now code never goes to if part as lastknownlocation null at first time.Can anyone give me solution for this ?
Is there a way to get currentlocation details without lastknownlocation method ?
 
Tim Moores
Bartender
Pie
Posts: 2496
9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't loop forever on the onCreate method - you need to return from that quickly, live you would do for all other lifecycle methods. Any GUI changes should be triggered from the various listeners, like onLocationChanged and onClick.

I don't understand your question - why does the code rely on there being a lastknownlocation? There won't necessarily be one, as you have found out. Nor will there be a currentlocation until you get onLocationChanged updates. You will need to decide what the app should do until there is a currentlocation.
 
sam liya
Ranch Hand
Posts: 1240
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
k.But i mean if the location changes countinously it automatically calls the onLocationChanged.So if i need to show it on the map i have to call below code coutinously.So is it correct to code below one in onLocationChanged activity ?



 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic