I’m fetching all the ‘s stores in “Göteborg” and adding a marker on my mapView.
The problem is that with this code my markers get all bunched up in Africa.
I’ve checked that coordinates is correct so it isnt that.
Anyone know what’s the problem is?
df = ((ClassHandler)getApplication()).getStoreDatabadeFacade();
Cursor plotstore = df.getAllStorePos("Göteborg");
startManagingCursor(plotstore);
plotstore.moveToFirst();
while(plotstore.isAfterLast() == false){
GeoPoint addStore = new GeoPoint(plotstore.getColumnIndex("lat"), plotstore.getColumnIndex("long"));
//OverlayItem overlayitem = new OverlayItem(addStore, plotstore.getString(plotstore.getColumnIndex("_ID")), plotstore.getString(plotstore.getColumnIndex("ADDRESS")));
OverlayItem overlayitem = new OverlayItem(addStore, plotstore.getString(plotstore.getColumnIndex("_id")), plotstore.getString(plotstore.getColumnIndex("address")));
itemizedStoreOverlay.addOverlay(overlayitem);
storeOverlays.add(itemizedStoreOverlay);
plotstore.moveToNext();
}
Doesn’t
getColumnIndexjust return the index of the column within thecursor, rather than the value at that index? You seem to be using it correctly for theid:but not for the
latandlong:Try changing this (and the
"long") to: