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 6529019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:35:23+00:00 2026-05-25T09:35:23+00:00

I am making a map application in which i have 20 restaurant data and

  • 0

I am making a map application in which i have 20 restaurant data and i want to show all restaurant in Map using overlay pin.Now my actual problem is I want to show index number on each and every pin (eg if 20 pin is there ,all pin should be with index no 1,2 ,3 which represent restaurant no from list). can anyone tell me how can i put index number on single pin image..??i want to use same image for overlay

  • 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-25T09:35:23+00:00Added an answer on May 25, 2026 at 9:35 am

    This is a fact I discovered later in my project: MapView is actually a ViewGroup (also mentioned here). So instead of using the somehow complicated Overlay and attaching drawables, you can just create a button (or a textview, or some nested layout, or whatever you want to display above a map), assign it a MapView.LayoutParams instance, and add it to the MapView.

    In code:

    // Create the overlay pin
    View overlayPin = getLayoutInflater().inflate(R.layout.overlay_pin, null);
    // Number it according to your question, e.g.
    ((TextView)(overlayPin.findViewById(R.id.overlay_text))).setText("1"); 
    

    Let’s say you want to place the pin on geo coordinates -60, 30.

    // Set a layout params to the pin.
    overlayPin.setLayoutParams(new MapView.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, new GeoPoint(-60000000, 30000000), MapView.LayoutParams.BOTTOM_CENTER);
    // Add the pin to the map
    mapView.addView(overlayPin);
    

    In this way you can have only one graphic asset for the background of the pin, and use a TextView for the numbering.

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

Sidebar

Related Questions

Friends i am making an application in which i am using Map Activity. Now
I am making an app in which i have to show Map in my
I am using the cool map making program DIY map and i want to
What I want is lots of nodes which can expand making a mind map.
I am making Map application and I have already able to call web service
I'm making a C# inventory application. However, I want there to be a map
I am making one project in which use of map-view is required. I have
Making an adobe flex ui in which data that is calculated must use proprietary
I'm making a Java ME application for Symbian S60 5th edition and I have
In my application, I have URN-identified data coming in from the server. I'm in

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.