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

  • SEARCH
  • Home
  • 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 3614168
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:12:54+00:00 2026-05-18T22:12:54+00:00

I am currently working on an application that makes use of a MapView and

  • 0

I am currently working on an application that makes use of a MapView and adds overlays to it. Basically at anyone one given time the overlay list should never exceed two.

Heres what I have tried to do…

I have extended the ItemizedOverlay class (MyFriendOverlay) and then created a private ArrayList object inside that extended class that I would attach the overlays to. However; I have come across a problem that I am unsure how to fix. If you look at this segment of code:


ImageView mapMarker = new ImageView(getApplicationContext());
mapMarker.setImageResource(R.drawable.markertrp);

myPointsToShow = new myFriendOverlay(mapMarker.getDrawable(), getApplicationContext());

As can be noted here I am created a ImageView with an icon based on my drawables. After this I have my extended class from ItemizedOverlay. In the constructor it takes two parameter the drawable and the context.

From what I know the constructor below is required (perhaps it can be modified):


public myFriendOverlay(Drawable defaultMarker, Context context)

Problem here is that I keep creating a new instance of myPointsToShow, which is a problem because I have a ArrayList that I want to use in the extended class so I have direct control over the overlays. And by instantiating a new one every time, I don’t really add to the list itself.

In short:

All I want is for my application to have two points (A and B) where if a new location is detected for say B, then remove B from the overlay list, and replace it with the new location. And the same for A as well. In order to simplify it, I want to attach index 0 to A and index 1 to B, so that it doesn’t span over two points.

I am unable to come up with a solution for this because of the problem of the necessary constructor, perhaps I’m thinking too hard about it…

Please offer any feedback! 🙂

Thanks for reading.

  • 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. Editorial Team
    Editorial Team
    2026-05-18T22:12:54+00:00Added an answer on May 18, 2026 at 10:12 pm

    From my experience what I do is the following:

    • Create an item overlay per type of image I am going to show.
    • If the list of items per overlay is not very long I pass it inside an intent.

    Btw you need to use R.drawable.something for your overlay. You don’t need to create an ImageView.

    I have been using this android-library for maps: android-mapviewballoons. Check it out!

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

Sidebar

Related Questions

I'm currently working on a (relatively) basic web application that functions as a time
The application i am currently working on makes heavy use of the repository pattern
Here's the situation: I'm currently working on a substantially large .Net application that makes
Am currently working on an application that requires users to submit posts and comments
I'm currently working in an application that has to navigate a webpage and recollect
I am currently working on an application that has different permissions/users for the local
I'm currently working on an application that allows people to schedule Shows for an
I am currently working on an application that allows reverse geocoding using silverlight +
I am currently working on an application that uses a TableViewer in several places
I am currently working on an application that will retrieve other users' locations based

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.