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

Android: mapview.toImage() gives empty map

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: Release 5.0.2
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      OSX Yosemite
      Titanium sdk 5.0.0GA
      Appcelerator studio 4.3.0
      Ti.map 2.3.3
      Device (Galaxy note 2)
      Genymotion simulator (Google Nexus 5, API 22)

      Description

      Hi,
      I'm facing this problem since fews days, I can't get an image of my mapview on Android. This is working perfectly on IOS.
      I have created a mapview, I added it to one of my Alloy view.
      var mapview = Map.createView(

      { mapType : Map.NORMAL_TYPE, animate : true, region : region, regionFit : true, userLocation : false, visible : true, top : 0, width : '100%' }

      );
      //I Add annotations and a path ... I skipped this part
      $.mapContainer.add(mapview)
      //My map is showing perfectly on the screen
      function onClickShare()

      { var Blob = $.mapContainer.toImage(); // I tried also : $.mapContainer.toImage().media, mapview.toImage(), and mapview().toImage.media // .media is not valid image, mapview.toImage() gives me same result var file = Titanium.Filesystem.getFile(Titanium.Filesystem.tempDirectory, 'share_map.png'); file.write(Blob); //Calling my functions to share on social networks shareHelper.share(); }

      My image is existing, the only thing is that I get an empty map : http://postimg.org/image/i1u0emfyr/
      I also tried to do a screenshot of the whole screen with Titanium.Media.takeScreenshot, I get all the elements of my view but map still empty.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              joakimm joachim mercier
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code