[android-developers] trying to get polylines to work in google maps api v2

2013-01-11 Thread John Merlino
Using google maps api v2, I had multiple markers displaying correctly
but I wanted to add a line joining them, so I added the polyline
functionality below. However, when I rendered map again, now it just
shows map without markers or line:

 IteratorMapString, String iterator2 = historyData.iterator();
while(iterator2.hasNext()){

MapString, String item = 
iterator2.next();

double currentLat = 
Double.parseDouble(item.get(latitude));
double currentLong = 
Double.parseDouble(item.get(latitude));



Double.parseDouble(item.get(longitude));


mMap.addMarker(new MarkerOptions()
.position(new LatLng(currentLat, currentLong))
.title(item.get(address)));



Polyline line = 
mMap.addPolyline(new PolylineOptions()
   .add(new LatLng(currentLat, 
currentLong))
   .width(5)
   .color(Color.RED));


}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] trying to get polylines to work in google maps api v2

2013-01-11 Thread TreKing
On Fri, Jan 11, 2013 at 3:43 PM, John Merlino stoici...@aol.com wrote:

  double currentLat =
 Double.parseDouble(item.get(latitude));
 *double currentLong =
 Double.parseDouble(item.get(**latitude));*
 

mMap.addMarker(new MarkerOptions()
 .position(*new LatLng(currentLat,
 currentLong)*)
 .title(item.get(address)));


The fact that you're using latitude for currentLong would probably skew
things on the map ...

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en