google maps - Android: Got right lat and long but markers are printed at the wrong place -
i'm fetching 's stores in "göteborg" , adding marker on mapview. problem code markers bunched in africa.
i've checked coordinates correct isnt that.
anyone know what's 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 getcolumnindex
return index of column within cursor
, rather value @ index? seem using correctly id
:
plotstore.getstring(plotstore.getcolumnindex("_id"))
but not lat
, long
:
plotstore.getcolumnindex("lat")
try changing (and "long"
) to:
plotstore.getint(plotstore.getcolumnindex("lat"))
Comments
Post a Comment