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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:29:26+00:00 2026-06-03T22:29:26+00:00

i am develpoing a map application with osm. i want to create some marker

  • 0

i am develpoing a map application with osm. i want to create some marker on my mapview. im using the folowwing code:

this.mMyLocationOverlay = new ItemizedOverlay<OverlayItem>(this, items,
                new ItemizedOverlay.OnItemGestureListener<OverlayItem>() {
                    @Override
                    public boolean onItemSingleTapUp(final int index, final OverlayItem item) {
                        Toast.makeText(
                                SampleWithMinimapItemizedoverlay.this,
                                "Item '" + item.mTitle + "' (index=" + index
                                        + ") got single tapped up", Toast.LENGTH_LONG).show();
                        return true; // We 'handled' this event.
                    }

                    @Override
                    public boolean onItemLongPress(final int index, final OverlayItem item) {
                        Toast.makeText(
                                SampleWithMinimapItemizedoverlay.this,
                                "Item '" + item.mTitle + "' (index=" + index
                                        + ") got long pressed", Toast.LENGTH_LONG).show();
                        return false;
                    }
                }, mResourceProxy);

…

but in line 2 under the “new ItemizedOverlay.OnItemGestureListener” i get a red line and an error that says fix project setup. i am very confiused. why i get this error in eclipse? please help me

  • 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-06-03T22:29:28+00:00Added an answer on June 3, 2026 at 10:29 pm

    You can use something like that.
    – extend ItemizedOverlay

    package dispatch.driver.osmMaps;
    
    import java.util.ArrayList;
    
    import org.osmdroid.ResourceProxy;
    import org.osmdroid.api.IMapView;
    import org.osmdroid.views.overlay.ItemizedIconOverlay;
    import org.osmdroid.views.overlay.OverlayItem;
    
    import android.graphics.Point;
    
    public class OsmMapsItemizedOverlay extends ItemizedIconOverlay<OverlayItem>
    {
        private ArrayList<OverlayItem> mItemList = new ArrayList<OverlayItem>();
    
        public OsmMapsItemizedOverlay(ArrayList<OverlayItem> pList,
                ItemizedIconOverlay.OnItemGestureListener<OverlayItem> pOnItemGestureListener, ResourceProxy pResourceProxy)
        {
            super(pList, pOnItemGestureListener, pResourceProxy);
            mItemList = pList;
            // TODO Auto-generated constructor stub
        }
    
        public void addOverlay(OverlayItem aOverlayItem)
        {
            mItemList.add(aOverlayItem);
            populate();
        }
    
        public void removeOverlay(OverlayItem aOverlayItem)
        {
            mItemList.remove(aOverlayItem);
            populate();
        }
    
        @Override
        protected OverlayItem createItem(int i)
        {
            return mItemList.get(i);
        }
    
        @Override
        public int size()
        {
            if (mItemList != null)
                return mItemList.size();
            else
                return 0;
        }
    
        @Override
        public boolean onSnapToItem(int arg0, int arg1, Point arg2, IMapView arg3)
        {
            // TODO Auto-generated method stub
            return false;
        }
    
    }
    

    And in your activity class call

    private void PrepareItemizedOverlay()
        {
            /* itemized overlay */
            mItemizedOverlay = new OsmMapsItemizedOverlay(mItems,
                    new ItemizedIconOverlay.OnItemGestureListener<OverlayItem>()
                    {
                        @Override
                        public boolean onItemSingleTapUp(final int index, final OverlayItem item)
                        {
    
                            Toast.makeText(OsmMapsActivity.this,
                                    "Item '" + item.mTitle + "' (index=" + index + ") got single tapped up",
                                    Toast.LENGTH_LONG).show();
    
                            return true; // We 'handled' this event.
                        }
    
                        @Override
                        public boolean onItemLongPress(final int index, final OverlayItem item)
                        {
    
                            Toast.makeText(OsmMapsActivity.this,
                                    "Item '" + item.mTitle + "' (index=" + index + ") got long pressed", Toast.LENGTH_LONG)
                                    .show();
    
                            return true;
                        }
                    }, mResourceProxy);
        }
    

    to add a new overlay you can use something like this:

    {    OverlayItem overlayItem;
    
    
                overlayItem = new OverlayItem("Center", "Center", (GeoPoint) aPoint);
    
    
    
                mItemizedOverlay.addOverlay(overlayItem);
    
                mMapView.getOverlays().clear();
                mMapView.getOverlays().add(mItemizedOverlay);
                mMapView.getController().animateTo(aPoint);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm very new to ios development. I'm developing a map application where I
Context I'm developing an application in Java. I want a fairly high resolution map/globe
i'm new to gooogle map developing.i want to make a map as follows. http://edition.cnn.com/SPECIALS/world/arab-unrest/index.html
I'm developing a map application in Android. I'm using Google maps API to show
Developing iphone application using makkit framework. I have got the map view integrated in
I am developing JavaME LWUIT application which needs to display some data on map.
we are developing an offline city map application for iPad, using Cloudmade SDKs. I'm
I am currently developing a Silverlight OOB application using the Bing Map Control, however
I am developing a google map application using adobe flex 4.5 . I need
I am developing an application that draws map. Currently my logic looks like this:

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.