Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-16228

Android: Maps V2 selectAnnotation doesn't work before map complete event

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Low
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      3.2.0.GA

      Description

      The selectAnnotation method doesn't work before the complete event - see code below. Please fix or document this behavior.

      index.xml:

      <Alloy>
          <Window>
              <!-- Use the Alloy.Globals.Map namespace to create a map module view -->
              <View id="mapview" ns="Alloy.Globals.Map"/>
          </Window>
      </Alloy>
      

      index.tss:

      "#mapview": {
      	mapType: Alloy.Globals.Map.NORMAL_TYPE,
      	animate:true,
      	regionFit:true,
      	userLocation:true
      }
      

      index.js:

      // API calls to the map module need to use the Alloy.Globals.Map reference
      var mountainView = Alloy.Globals.Map.createAnnotation({
          latitude:37.390749,
          longitude:-122.081651,
          title:"Appcelerator Headquarters",
          subtitle:'Mountain View, CA',
          pincolor:Alloy.Globals.Map.ANNOTATION_RED
      });
       
      $.mapview.region = {latitude:37.390749, longitude:-122.081651,
                          latitudeDelta:0.05, longitudeDelta:0.05};
      $.mapview.addAnnotation(mountainView);
      $.mapview.selectAnnotation(mountainView); // DOES NOT WORK
      /* Uncomment this to make it work
      $.mapview.addEventListener('complete', function() {
      	$.mapview.selectAnnotation(mountainView);
      });
      */
      $.index.open();
      

      alloy.js:

      if (OS_ANDROID){
      	Alloy.Globals.Map = require('ti.map');
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mokesmokes Mark Mokryn
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-18223
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code