Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13003] Android: Maps V2 module - Enable/disable the my-location button of GoogleMaps

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2013-05-09T22:52:22.000+0000
Affected Version/sRelease 3.1.0
Fix Version/s2013 Sprint 10 API, 2013 Sprint 10, Release 3.1.1, Release 3.2.0
ComponentsAndroid
LabelsSupportTeam, module_androidmapv2, qe-testadded
ReporterEduardo Gomez
AssigneePing Wang
Created2013-03-08T16:18:50.000+0000
Updated2014-02-19T08:57:50.000+0000

Description

Feature request

Client would like to remove the "my-location" icon (PNG image attached), app already has it, and the old maps did not so client would really like to remove this.

Android APIs

Expose below method may allow developers to accomplish the request: http://developer.android.com/reference/com/google/android/gms/maps/UiSettings.html#isMyLocationButtonEnabled()

Comments

  1. Ping Wang 2013-03-19

    Eduardo, if you set "userLocation: false" when creating the map, the my location button won't show up.
  2. Eduardo Gomez 2013-03-19

    Edit: mFoundry had set the userLocation property on the map to false in order to remove the my-location button from the map. But this also removes the users current location. Based on below link looks like exposing the method would work. Topic: http://stackoverflow.com/questions/14376361/disable-center-button-in-mylocation-at-google-map-api-v2 Method: https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/UiSettings#isMyLocationButtonEnabled() They need to be able to perform the following: (1) Remove the users get my location icon. (2) Show the users current location on the map. (3) Do NOT center the map on the current location, just show it.
  3. Ping Wang 2013-05-09

    PR: https://github.com/appcelerator/titanium_modules/pull/109 Test case:
       var MapModule = require('ti.map');
        
       var win = Ti.UI.createWindow({fullscreen: false});
       
       var map = MapModule.createView({
           userLocation: true,
           userLocationButton: true,
           mapType: MapModule.NORMAL_TYPE,
           animate: true,
           top: '30%'
       });
       
       var b1 = Ti.UI.createButton({
           title: "Toggle userLocation",
           top: 0
       });
       b1.addEventListener('click', function(){
           map.userLocation = !map.userLocation;
           Ti.API.info("***************************** map.userLocation = " + map.userLocation);
       });
       
       var b2 = Ti.UI.createButton({
           title: "Toggle userLocationButton",
           top: 100
       });
       b2.addEventListener('click', function(){
           map.userLocationButton = !map.userLocationButton;
           Ti.API.info("***************************** map.userLocationButton = " + map.userLocationButton);
       });
        
       win.add(b1);
       win.add(b2);
       win.add(map);
       win.open();
       
    For FR, run the above test case. Should see a blue dot showing the user's current location and the my-location button in the top right corner of the map. Click the two buttons to toggle "userLocation" and "userLocationButton". *Note:* the my-location button only shows when userLocation==true && userLocationButton==true.
  4. Ping Wang 2013-05-13

    This fix is in the Map module now and we will bundle this module with the SDK starting from 3.1.1 (TIMOB-13791). So this fix will be in 3.1.1.
  5. Eric Merriman 2013-05-31

    Verified this feature is functioning as expected. Using: Mac OS 10.8.3 Safari: 6.0.4 Xcode 4.6.2 CLI: 3.1.1-alpha titanium-code-processor: 1.0.1-alpha Alloy: 1.1.3-alpha Appcelerator Studio, build: 3.1.1.201305292130 Titanium SDK version 3.1.1.v20130529114554 Nexus 4 4.2.1

JSON Source