GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-02-10T17:26:28.000+0000 |
Affected Version/s | Release 2.1.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 06 API, 2013 Sprint 06, Release 3.2.0 |
Components | Android |
Labels | SupportTeam, community, core, exalture, mapv2, qe-testadded, titanbeta, triage |
Reporter | Shawn Lipscomb |
Assignee | Ping Wang |
Created | 2012-07-06T11:45:23.000+0000 |
Updated | 2015-08-27T16:41:46.000+0000 |
Problem
The annotations in a Map View can't find their *image* unless it is directly in the \Resources\android\images\ subdirectory. When multiple versions (sizes) of an image file are correctly placed in the density-specific subdirectories (\Resources\android\images\medium\, \Resources\android\images\high\, etc.), they cannot be found (aren't used), even after cleaning and rebuilding the project.
Expected behavior
The pin should show on the map.
Actual behavior
No pin shows on the map.
Testcase
Use the attached test project, which contains the entire project directory structure. The app.js contents are also shown here for completeness:
{panel:title=app.js}
var win1 = Ti.UI.createWindow({
backgroundColor:'#fff',
exitOnClose:true,
navBarHidden:true,
layout:'vertical'
});
var map1=Ti.Map.createView({
mapType:Ti.Map.STANDARD_TYPE,
animate:true,
region:{latitude:37.423156, longitude:-122.084917,
latitudeDelta:0.01, longitudeDelta:0.01},
regionFit:true,
annotations:[Ti.Map.createAnnotation({
latitude:37.423156,
longitude:-122.084917,
image:'/images/MapPin.png'
})],
userLocation:true,
height:Ti.UI.Fill
});
win1.add(map1);
var square1=Ti.UI.createView({
height:20,
width:20,
backgroundColor:'red',
bottom:10,
left:10
});
map1.add(square1);
win1.open();
{panel}
if somebody needs to make this work, it's very easy to resolve: https://github.com/iamyellow/titanium_mobile/commit/40040a0d981dfe196a9594a12612ba7d15bd9700
https://github.com/appcelerator/titanium_mobile/pull/3943
Modified code to incorporate review comments
Fix for Maps V2 module: https://github.com/appcelerator/titanium_modules/pull/92
Tested with: SDK: 3.1.0.v20130316201654 Studio:3.1.0.201303091040 Device: Samgung galaxy note(v 2.3.6)
Reopening based on comments.
Tested with SDK 3.2.0.GA and map module 2.1.2. The annotation image shows fine in density-specific directories (/Resources/android/images/high/applogo.png).
Re-marking this as fixed based on [~pwang]'s comments. Please reopen if still an issue.
Closing the issue as working as expected. Map View annotations is visible if their image is in density subdirectories Test Environment: Appc-Studio:3.2.3.201404151910 sdk:3.2.3.v20140416151718 acs:1.0.14 alloy:1.3.1 npm:1.3.2 titanium:3.2.3-beta titanium-code-processor:1.1.1-beta1 xCODE:5.1.1 Device:Nexus7(v4.4.2)
This is still happening in my current current environment. Appc-Studio: 4.2.0.201508062204 SDK: 4.1.0.GA alloy: 1.7.5 npm: 1.4.9 Emulator: Genymotion Android 4.2.2 720X1280 320 dpi Device: Nexus 4 Android 5.1.1 1280x768 320 dpi