Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 44561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:40:17+00:00 2026-05-10T15:40:17+00:00

Has anyone managed to use ItemizedOverlays in Android Beta 0.9? I can’t get it

  • 0

Has anyone managed to use ItemizedOverlays in Android Beta 0.9? I can’t get it to work, but I’m not sure if I’ve done something wrong or if this functionality isn’t yet available.

I’ve been trying to use the ItemizedOverlay and OverlayItem classes. Their intended purpose is to simulate map markers (as seen in Google Maps Mashups) but I’ve had problems getting them to appear on the map.

I can add my own custom overlays using a similar technique, it’s just the ItemizedOverlays that don’t work.

Once I’ve implemented my own ItemizedOverlay (and overridden createItem), creating a new instance of my class seems to work (I can extract OverlayItems from it) but adding it to a map’s Overlay list doesn’t make it appear as it should.

This is the code I use to add the ItemizedOverlay class as an Overlay on to my MapView.

// Add the ItemizedOverlay to the Map private void addItemizedOverlay() {   Resources r = getResources();   MapView mapView = (MapView)findViewById(R.id.mymapview);   List<Overlay> overlays = mapView.getOverlays();    MyItemizedOverlay markers = new MyItemizedOverlay(r.getDrawable(R.drawable.icon));   overlays.add(markers);    OverlayItem oi = markers.getItem(0);   markers.setFocus(oi);   mapView.postInvalidate(); } 

Where MyItemizedOverlay is defined as:

public class MyItemizedOverlay extends ItemizedOverlay<OverlayItem> {   public MyItemizedOverlay(Drawable defaultMarker) {     super(defaultMarker);     populate();   }    @Override   protected OverlayItem createItem(int index) {     Double lat = (index+37.422006)*1E6;     Double lng = -122.084095*1E6;     GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());      OverlayItem oi = new OverlayItem(point, 'Marker', 'Marker Text');     return oi;   }    @Override   public int size() {     return 5;   }  } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:40:18+00:00Added an answer on May 10, 2026 at 3:40 pm

    For the sake of completeness I’ll repeat the discussion on Reto’s post over at the Android Groups here.

    It seems that if you set the bounds on your drawable it does the trick:

    Drawable defaultMarker = r.getDrawable(R.drawable.icon);  // You HAVE to specify the bounds! It seems like the markers are drawn // through Drawable.draw(Canvas) and therefore must have its bounds set // before drawing. defaultMarker.setBounds(0, 0, defaultMarker.getIntrinsicWidth(),     defaultMarker.getIntrinsicHeight());  MyItemizedOverlay markers = new MyItemizedOverlay(defaultMarker); overlays.add(markers); 

    By the way, the above is shamelessly ripped from the demo at MarcelP.info. Also, here is a good howto.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer From an information security perspective, this only makes sense if… May 11, 2026 at 11:21 am
  • added an answer Problem solved; there's two pieces to the puzzle. The /O… May 11, 2026 at 11:21 am
  • added an answer I get a different, more reasonable error (with g++ 4.3.3):… May 11, 2026 at 11:21 am

Related Questions

Has anyone managed to use ItemizedOverlays in Android Beta 0.9? I can't get it
Has anyone managed to get subsonic or a variant working on Windows Mobile? We
Has anyone managed to activate Gzip compression on a website in IIS6 ? We're
Has anyone worked much with Microsoft's Managed Extensibility Framework (MEF)? Kinda sounds like it's
Has anyone tried installing SQL Server 2008 Developer on a machine that already has
Has anyone ever set up Cruise Control to build an OS X Cocoa/Objective-C project?
Has anyone looked at Yahoo's ASTRA ? It's fairly nifty, but I had some
Has anyone run into this error message before when using a timer on an
Has anyone been able to get an NHibernate-based project up and running on a
Has anyone built a website with IronPython and ASP.NET. What were your experiences and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.