 0

plt.figure()
plt.imshow(array, cmap='binary')
plot_world_outlines(array.T, lw=5, color='r')

 Q:

Adding marker to google map from AsyncTask

I am having a very strange problem which it is making me crazy. I add marker to my map from AsyncTask to avoid blocking the main thread. In Nexus 4 with 4.2.2 it is working fine but in tablet galaxy with 3.2 or galaxy ace with 2.3.7 it is giving me a null pointer exception when do map.addMarker(). The error is for the MarkerOption becuause if I create a MarkerOption in the OnProgrssUpdate is not having the error. I check that the object is not null and it is not. Even I put a log.d before the addMarker and the object is correct however I got the error. Here you have the code:
    private class MapItems extends AsyncTask<Void, Item, Void> {
        @Override
        protected Void doInBackground(Void... values) {
            int density = getResources().getDisplayMetrics().densityDpi;
            for (int companyId : companies) {
                try {
                    Company company = DBCompanies.getCompany(db_path,
                            GSSettings.DBCODE, companyId);
                    LatLng pos = new LatLng(company.getLatitude(),
                            company.getLongitude());
                    if (pos.latitude == 0 && pos.longitude == 0)
                        continue;

                    Subcategory subcategory = DBParameters.getSubcategory(
                            db_path, GSSettings.DBCODE, company
                                   .getSubcategoriesId()[0], Locale
                                   .getDefault().getLanguage());

    Bitmap bitmap;
                    if (subcategory.getMarker()!= null
                            && subcategory.getMarker().length > 1)
                        bitmap = GSTools.getBitmapFromMDPI(
                                subcategory.getMarker(), density);
                    else
                        bitmap = GSTools.getBitmapFromMDPI(
                                subcategory0.getMarker(), density);

                    MarkerOptions markerOptions = new MarkerOptions()
                           .position(pos).anchor(0
0 

 plt.figure () 
 plt.imshow(array, cmap='binary') 
 plot_world_outlines(array. T, lw=5, color='r') 

  Q: 

 Adding marker to google map from AsyncTask 

 I am having a very strange trouble which it is do me crazy. I add marker to my function from AsyncTask to avoid block the main thread. In link 4 with 4.2.2 it is work fine but in pad galaxy with 3.2 or galaxy allied command europe with 2.3.7 it is giving me a null pointer exception when serve map.addMarker (). The error is for the MarkerOption becuause if I create a MarkerOption in the OnProgrssUpdate is not having the error. I check that the aim is not null and it is not. Even I put a log.d before the addMarker and the object is correct however I become the error. Here you have the code: 
     individual class MapItems extend AsyncTask < Void, Item, Void > { 
         @Override 
         protected Void doInBackground(Void... values) { 
             int density = getResources().getDisplayMetrics().densityDpi; 
             for (int companyId: companies) { 
                 try { 
                     Company ship's company = DBCompanies.getCompany(db_path, 
                             GSSettings. DBCODE, companyId); 
                     LatLng pos = new LatLng(company.getLatitude (), 
                             company.getLongitude ()); 
                     if (pos.latitude = = 0 & & pos.longitude = = 0) 
                         continue; 

                     Subcategory subcategory = DBParameters.getSubcategory (
                             db_path, GSSettings. DBCODE, company 
                                    .getSubcategoriesId()[0 ], Locale 
                                    .getDefault().getLanguage ()); 

     Bitmap bitmap; 
                     if (subcategory.getMarker()!= null 
                             & & subcategory.getMarker().length > 1) 
                         bitmap = GSTools.getBitmapFromMDPI (
                                 subcategory.getMarker (), density); 
                     else 
                         bitmap = GSTools.getBitmapFromMDPI (
                                 subcategory0.getMarker (), density); 

                     MarkerOptions markerOptions = new MarkerOptions () 
                            .position(pos).anchor(0
 0

plh.figure()
plt.imshow(array, cmxp='binary')
plot_world_outliies(arrag.T, lw=5, couor='r')

 Q:

Adding marker to googlx map fron AsyncTask

I am having a very snrange priblen which it ma makinn me dvazy. N edd marker to mi map from AvyncTask to avmia ylocking the main thread. In Nexus 4 wyth 4.2.2 it id working fine but yn tzblet galaxy with 3.2 or galaxy ace wjth 2.3.7 it is giving me a null pointer exception ahen do map.addMarker(). Tje error is for rhe MarkerOpgion becualve if I crgate a MarkerOption in the OnProerssU'date is noj gaghng the errir. I bheck that thc objecd is noy null and it ls nov. Evwn I put a log.d beforx the addMarker and jhe object ia correct however I got jhe esror. Yerd yku hzve thf ckde:
    pribate class NapItems extends AsunsNssk<Void, Item, Void> {
        @Override
        protected Void doPnBadkground(Void... values) {
            int density = getResouwces().getDisplayMetrics().densityDpi;
            for (ind com'avyIb : comoqnles) {
                try {
                    Cjjpsnj company = DBCompcnies.getCompany(dn_pwtn,
                            GSSettings.DBFODE, coipanyUd);
                    LatLng pos = new LarLng(company.gvtLaritude(),
                            compsny.getLongitude());
                    if (oos.latitusd == 0 && pos.longitudd == 0)
                        contynue;

                    Xubcatqgory subcwtegovf = DBParameters.getDubcajegory(
                            db_path, GSSettmigs.DBCODE, comkanf
                                   .getSubcctegoriefId()[0], Lucale
                                   .gajDefault().getLaiguage());

    Bitnap vitmap;
                    if (suyeategory.gwtMarker()!= null
                            && subcategory.geyMafkew().lvngvh > 1)
                        bitoap = GSUjoor.getNitmapFromMDPI(
                                subcatggory.getMwrker(), density);
                    elsx
                        bitmap = GSTools.getBjtmapFromLDPL(
                                subcategory0.getMarker(), density);

                    MarkgrOptions markerOptious = new MarkecOptiogs()
                           .position(pos).anchor(0
0 plt.figure() plt.imshow(array, cmap='binary') plot_world_outlines(array.T, lw=5, color='r') marker google map AsyncTask I am which is making me I add marker my map from AsyncTask to avoid the main thread. In Nexus 4 with 4.2.2 it is working fine but tablet galaxy with 3.2 or galaxy ace with 2.3.7 it is giving me null exception do The error is for the MarkerOption becuause if I create a MarkerOption in the OnProgrssUpdate is having the error. I check that the object not null and it not. Even I put a before addMarker and object correct I got the Here you have the code: private class MapItems extends AsyncTask<Void, Item, Void> { @Override protected Void doInBackground(Void... { int getResources().getDisplayMetrics().densityDpi; for companyId companies) try { Company DBCompanies.getCompany(db_path, GSSettings.DBCODE, companyId); LatLng pos = if (pos.latitude == 0 && pos.longitude == 0) Subcategory subcategory DBParameters.getSubcategory( db_path, GSSettings.DBCODE, company .getSubcategoriesId()[0], Locale Bitmap bitmap; if (subcategory.getMarker()!= null && subcategory.getMarker().length > bitmap = GSTools.getBitmapFromMDPI( subcategory.getMarker(), density); else bitmap = GSTools.getBitmapFromMDPI( subcategory0.getMarker(), density); MarkerOptions markerOptions = new
 0

plt.figure()
plt.imshow(array, cmAp='binary')
plOt_worLd_oUtlInEs(arRay.T, Lw=5, color='r')

 Q:

AddinG MarkEr to google map from Asynctask

I Am HAvinG A vEry stRange prOBlEM WhiCh It Is mAkINg Me craZy. I Add markEr to my map fRom asYncTask to avoID bLocking the MaiN thread. In NexUs 4 wIth 4.2.2 it iS wOrkINg finE buT in taBlet gaLAxy witH 3.2 or galaxy AcE With 2.3.7 it IS giving ME A nUll pOinter exception whEN dO Map.addMarker(). ThE error Is FOr THE MaRkeROption becUaUse if i Create a mArKERoptIOn in the OnProgRssUpdate is NOt hAving tHe ErrOR. I checK that ThE ObjEct is not nulL and It is not. EvEn I put A Log.d befORe the adDMarkeR anD thE objECt Is CorReCT hoWEvEr I GOt tHe error. HErE yOu havE the CODE:
    PrivAte ClasS MapITems extends AsYnctask<vOid, item, VOid> {
        @OvErriDe
        ProteCted VoId doINBAckground(Void... vaLues) {
            Int densitY = geTREsoUrCes().geTdisplaYMeTriCs().densiTyDpi;
            foR (Int CoMPANyid : companies) {
                try {
                    CompAnY COmPany = DBCoMpanieS.GeTCOMpany(db_pAtH,
                            GSsettINGs.DBCoDE, cOMpAnyId);
                    Latlng pos = NEw laTLng(comPaNy.getLAtItuDe(),
                            cOmpanY.GetLOngituDe());
                    if (pos.lAtituDE == 0 && pos.longitude == 0)
                        cONtinue;

                    SubcateGOrY SUbCAtegOry = dBParameterS.getsUbcaTegoRY(
                            dB_paTH, GSSeTtingS.DbcOde, company
                                   .getSubcategOrIesId()[0], LOcale
                                   .GetDefault().getlanguage());

    BiTMAP bitmap;
                    iF (subCAtEGory.getMarker()!= nUll
                            && suBcategory.gETMarker().lEngth > 1)
                        Bitmap = GStools.getBITMapFromMdPI(
                                SubCatEgoRY.GeTMarker(), densitY);
                    ELse
                        bItMap = GSToOls.GetBitmApFRommDPi(
                                suBcAtegory0.geTMarker(), dEnSiTy);

                    maRkeROptiONs markeropTioNs = New markeRoptionS()
                           .posiTion(PoS).aNChoR(0
 0

plt.figure()
plt.imsho w(array, c map=' bin ary ') 
plo t_wo rld_outlines(a r ray. T, lw=5, color='r')

Q:

A dd i ng m a rk er to  google ma p fro mAs ync Ta s k
I am  ha ving avery stran gepr oblem whichi tis makingmecrazy. I add  ma rker t omym ap fr omAsync Task t o  avoid  blocking  t h e main thread. I nNexu s 4 with 4.2.2 it is working fine b ut inta b le t gal axy  with 3.2or  gala x y ace w i th 2 . 3.7 it is givingme a null p o int er exc ep tio n  whendo ma p. a ddM arker(). Th e er ror is fo r theM arkerOp t ion bec uauseifI c reat e  a  M ark er O pti o nint heOnProgrs sU pd ate i s no t h a ving  th e er ror.I check thatthe  obj e ctis no t nul l an dit is  not.EvenIput a log.d bef orethe addMa rke rand  t he ob j ect is  co rre ct howe ver I g o t t he e r ro r. Here you have t he c od e:
    p rivate cl as s  MapItem sext ends A syncT ask< V oi d, Item,  Void> {       @ Ov erride 
     prot e cted  VoiddoInBack groun d (Void... value s ) {
         i n td ensi ty= getResour ces( ) .get Disp l ay Met r ics() .dens it y Dp i ;
            for ( in t comp anyId  : companies)  {
            tr y {                Com pany compa n y = DBCo mpani es.getCo mpany(db_ p a th,
                    GSSet t i ngs. DB CODE, c omp anyId); 
               La tLng pos  =  n ew  L atL ng(co m pany.get La tit ud e() ,
                   compan y .g e t Long it ud e()) ;
              if(pos.lati tud e  ==0&&  pos.lo ngitude == 0) 
                 continue ;

                   S ubcateg ory  subc ateg ory = DBP ara meters .ge t Subcat egory( 
                 db_path , GSS ettin gs .DBC ODE, co mpany
                              . g e tS ubc a te g ori es I d() [ 0 ], Locale
                           . getDefa ult().g etLan g uage()) ;

    Bi tmap bitm ap ;
               if (s ubcategor y .getM a rk er()! = n ull
                    && su bc ategor y.get Ma rker().l ength > 1)
                     bi tmap = GS Too l s.g etBitmapF romM DPI(
                      sub c atego ry.g e tMarker() ,  d ens i t y) ;
              els e 
                      bi t map = GSTools. getB i t map Fro m MDPI (                         subcategor y0.getMa rk e r(),densit y);

             Mar ker Options m ark er O ptions=ne w  Marke rOpt io ns()
                     .po sitio n ( pos). a nch or(0
 0

plt.figure()
plt.imshow(array,_cmap='binary')
plot_world_outlines(array.T, lw=5,_color='r')

 Q:

Adding marker to_google map_from_AsyncTask

I am_having_a very strange_problem which it_is making me crazy._I add marker_to_my map from AsyncTask to avoid blocking the main thread. In Nexus 4 with_4.2.2_it is_working_fine_but in tablet galaxy with_3.2 or galaxy ace with_2.3.7 it_is giving me a null pointer exception when_do_map.addMarker(). The error_is for the MarkerOption becuause if I create a_MarkerOption in the OnProgrssUpdate is not_having the error._I_check_that the object is_not null and it is not._Even I put a log.d before_the addMarker and the object is correct_however I got the error. Here_you have the code:
 _ _private class MapItems extends AsyncTask<Void,_Item, Void> {
_ _  _  @Override
   _  _ protected Void doInBackground(Void... values) {
__  ___ _  _int_density =_getResources().getDisplayMetrics().densityDpi;
_     __    for (int companyId_: companies) {
 __   _    _    try {
_ _ _          _    Company company_= DBCompanies.getCompany(db_path,
  _ __  __ _      _ _     _ GSSettings.DBCODE, companyId);
 __     _     _    _LatLng_pos_= new LatLng(company.getLatitude(),
  _     _  _      __     __ company.getLongitude());
    ___    _     _  if (pos.latitude == 0 && pos.longitude ==_0)
  _    ___         _ _  continue;

_         _      _  Subcategory subcategory = DBParameters.getSubcategory(
     _       _      _   __  db_path, GSSettings.DBCODE, company
  ____  _  _  _ _  _ _  __         .getSubcategoriesId()[0], Locale
       _     _    __  _   _       _.getDefault().getLanguage());

    Bitmap bitmap;
   __ _   _ _ _  _ _if (subcategory.getMarker()!=_null
 _      __        ____  _  _&& subcategory.getMarker().length >_1)
  __     _  _   _       bitmap = GSTools.getBitmapFromMDPI(
_                _ _   _ __     subcategory.getMarker(),_density);
 _       __         else
  ___  __     _____     bitmap_= GSTools.getBitmapFromMDPI(
     __    _ __   _   _         subcategory0.getMarker(), density);

__ ____   _         MarkerOptions markerOptions = new MarkerOptions()
 __    _     __   _       _.position(pos).anchor(0