Mapview events

You must Login before you can answer or comment on any questions.

When do you expect to implement mapview events such as click, etc?

1 Answer

It depends what you want to do.

If you wish to have an event on an annotation then create the listener on the annotation. This will make sure that each one functions independently.

You can put an event listener on the map itself, also on the popup description of the annotation.

To be more precise can you be more descriptive about what you actually want to do.

T

— answered 2 years ago by Trevor Ward
answer permalink
2 Comments
  • This is what I need precisely.

    googleMapView.addEventListener('click', function(e)
    {   
     
        // do something     
     
    });
    Yes, I am well aware about annotation events ... but this will not solve the problem.

    — commented 2 years ago by Brian Wells

  • more precisely.

    I need to add dynamic custom annotation images to a mapview. I have tried

    1. creating a button, and then converting toImage(), then adding this to the annotation image, eats up to much memory at 200-300 annotations
    2. tried using php to dynamically create the image server side, then pull down the image via request call, save locally and then add to the annotation image, this method is terrible as well
    3. last resort, placed a view over top of the map view, set touchEnabled to false and attach buttons to the view while translating the lat and long to x y coordinates within the view

    Regarding 3, the button annotations will not pan with the map and they remain on the screen until regionChanged is called while the user pans in the mapview. Now if Appcelerator actually included click or touchstart in the mapview events, this would be solved, rid the screen of the buttons once the map is clicked.

    Their incomplete APIs are causing me a headache

    — commented 2 years ago by Brian Wells

Your Answer

Think you can help? Login to answer this question!