Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19813] Android: mapview.toImage() gives empty map

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 5.0.2
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, empty, map, mapview, toimage
Reporterjoachim mercier
AssigneeUnknown
Created2015-10-05T15:19:59.000+0000
Updated2018-02-28T19:54:54.000+0000

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

FileDateSize
Capture d’écran 2015-09-30 à 20.01.48.png2015-10-05T15:19:11.000+000034916

Comments

  1. Aminul Islam 2015-10-27

    Hi, I have tested this issue . This is a valid bug. My Environment :
       Device (Nexus 7 android 5.1.0)
       Operating System
         Name                        = Mac OS X
         Version                     = 10.10.5
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 8589934592
       Node.js
         Node.js Version             = 0.10.37
         npm Version                 = 1.4.28
       Titanium CLI
         CLI Version                 = 5.0.5
       Titanium SDK
         SDK Version                 = 5.0.2.GA
         SDK Path                    = /Users/Raju/Library/Application Support/Titanium/mobilesdk/osx/5.0.2.GA
         Target Platform             = android
       
    Thanks

JSON Source