Skip to content

Android - addPolygons is not a function #263

@yozef

Description

@yozef

Ti.Map Release 4.4.0

index.xml

<Alloy>
	<Window class="container">
		<View id="mapview" module="ti.map"/>
	</Window>
</Alloy>

index.js

var Map = require('ti.map');
$.mapview.mapType = Map.NORMAL_TYPE;

var samplePolygons = [];

samplePolygons.push(Map.createPolygon({
        points: [{"longitude":-115.57617187499999,"latitude":36.527294814546245},{"longitude":-111.884765625,"latitude":31.42866311735861},{"longitude":-102.216796875,"latitude":32.175612478499325},{"longitude":-92.8125,"latitude":33.65120829920497},{"longitude":-100.283203125,"latitude":39.36827914916014},{"longitude":-108.45703125,"latitude":42.293564192170095},{"longitude":-115.57617187499999,"latitude":36.527294814546245}], 
        strokeColor: '#FCC248', strokeWidth: 4, zIndex: 2, bubbleParent: false, fillColor: "#FEE8BC"
}));
samplePolygons.push(Map.createPolygon({
    points: [{"longitude":-83.583984375,"latitude":42.22851735620852},{"longitude":-71.54296874999999,"latitude":42.4234565179383},{"longitude":-62.84179687499999,"latitude":48.40003249610685},{"longitude":-72.0703125,"latitude":52.908902047770255},{"longitude":-88.857421875,"latitude":47.81315451752768},{"longitude":-83.583984375,"latitude":42.22851735620852}], 
    strokeColor: '#878D99', strokeWidth: 4, zIndex: 2, bubbleParent: false, fillColor: "#C9CBCF"
}));

// $.mapview.addPolygons(samplePolygons); // Error on Android: $.mapview.addPolygons is not a function

for (var i = 0; i < samplePolygons.length; i++) {
	$.mapview.addPolygon(samplePolygons[i]);	// .addPolygon works, but addPolygons is throws error
}

$.index.open();

Uncomment $.mapview.addPolygons(samplePolygons); and you get an Error that the Function addPolygons dosen't exist.

The odd thing is, I can see the method mapped in the Android Module: https://github.com/appcelerator-modules/ti.map/blob/3359e673bfb99f1973887e611b546479b47809e2/android/src/ti/map/TiUIMapView.java#L783

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions