Google Maps - logo above and pin detection?


Last Updated:

  1. nofearinc

    nofearinc New Member This Topic's Starter

    Joined:
    Jun 18, 2010
    Messages:
    4
    Likes Received:
    0
    I am stuck with few problems related to the Google Maps API.

    1. I need to set an image logo over a MapView layout. I tried adding
    ImageView with background or resource image, but it is not visible and
    there are no z-index parameters to change. How could I add a logo
    image in the top corner of maps view?

    2. I am trying to handle an onClick event for a pin from the map. I
    have 100 pins. Is there any easy way to detect whether I have clicked
    on a pin/marker in order to show a popup or I have to calculate
    coordinates?

    3. Also, related to N2 - could I locate nearest pins from the current
    destination (when I locate myself via GPS) or I need to use X/Y coords
    to get the closest pins? I try not to overwhelm performance wise the
    application.

    Any ideas are highly appreciated :)
     

    Advertisement
  2. Droid Chris

    Droid Chris Member

    Joined:
    Jun 8, 2010
    Messages:
    14
    Likes Received:
    0
    Try using a map overlay that will allow you to place images over the google map. Then, when the screen is clicked, the image clicked will recieve focus.
     
  3. nofearinc

    nofearinc New Member This Topic's Starter

    Joined:
    Jun 18, 2010
    Messages:
    4
    Likes Received:
    0
    Thanks for the tips. Am I supposed to check onFocus events?

    Currently I get mapView.getProjection().fromPixels() method to get the geopoint object, but I'm not sure if it is appropriate to do when onClick is activated.

    Also I have serious performance problems when I set 100-120 pins on the map. I'm concerned about that because I need the pins attached to the map and I didn't expected such an impact. Is there any way to cache the pins or something like this? Now the garbage collector is called every 3 seconds and when I drag on the screen in order to move the map, it takes 1-2 seconds.
     
  4. nofearinc

    nofearinc New Member This Topic's Starter

    Joined:
    Jun 18, 2010
    Messages:
    4
    Likes Received:
    0
  5. Droid Chris

    Droid Chris Member

    Joined:
    Jun 8, 2010
    Messages:
    14
    Likes Received:
    0
    So the map view is good. You are drawing the pins with a canvas right? Anyways, 100 pins or more makes is a lot of overhead for the canvas right? Also, how can the user even see the map. Are you getting your info from a google query?:)
     
  6. nofearinc

    nofearinc New Member This Topic's Starter

    Joined:
    Jun 18, 2010
    Messages:
    4
    Likes Received:
    0
    I am adding 100 objects to different locations in the country so they are not always visible. I do use Overlay extended class to populate overlay items and try to tap them. So I need performance if possible with so many objects and to receive the onTap when clicked on the points :)
     

Share This Page

Loading...