dipakgurdhami / osmbonuspack

Automatically exported from code.google.com/p/osmbonuspack
0 stars 0 forks source link

no markers #20

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

latest OSMbonusPack
in OnCreate:
new Thread(new Runnable(){
                @Override
                public void run(){
                    RoadManager roadManager = new MapQuestRoadManager();
                    ArrayList<GeoPoint> waypoints = new ArrayList<GeoPoint>();
                    waypoints.add(new GeoPoint(latCoord[0]*1E6,lonCoord[0]*1E6));
                    waypoints.add(new GeoPoint(latCoord[1]*1E6,lonCoord[1]*1E6)); //end point
                    Road road = roadManager.getRoad(waypoints);
                    PathOverlay roadOverlay = RoadManager.buildRoadOverlay(road, mapView.getContext());
                    mapView.getOverlays().add(roadOverlay);
                    mapView.invalidate();
                    final ArrayList<ExtendedOverlayItem> roadItems = new ArrayList<ExtendedOverlayItem>();
                    ItemizedOverlayWithBubble<ExtendedOverlayItem> roadNodes = new ItemizedOverlayWithBubble<ExtendedOverlayItem>(ct,roadItems,mapView);
                    mapView.getOverlays().add(roadNodes);
                    Drawable marker = getResources().getDrawable(R.drawable.marker_node);
                    for (int i=0; i<road.mNodes.size(); i++){
                            RoadNode node = road.mNodes.get(i);
                            ExtendedOverlayItem nodeMarker = new ExtendedOverlayItem("Step "+i, "", node.mLocation, ct);
                            nodeMarker.setMarkerHotspot(OverlayItem.HotspotPlace.CENTER);
                            nodeMarker.setMarker(marker);
                            roadNodes.addItem(nodeMarker);
                    }
                    mapView.invalidate();
                }
            });
marker does not appear!
data from an array of coordinates is not empty!!!
what is wrong?

Original issue reported on code.google.com by russkaya...@gmail.com on 14 Apr 2013 at 6:20

GoogleCodeExporter commented 8 years ago
1) new GeoPoint(latCoord[0]*1E6,lonCoord[0]*1E6) ??? You multiply by 1E6? What 
is the value of latCoord[0]?

2) After trying to get the road with: Road road = roadManager.getRoad(waypoints)
you should check the result: 
if (road.mStatus == Road.STATUS_DEFAULT), then you got an error. 

Original comment by mathieu....@gmail.com on 15 Apr 2013 at 3:24

GoogleCodeExporter commented 8 years ago

Original comment by mathieu....@gmail.com on 24 Aug 2013 at 4:13