Search code examples
google-mapstitaniumapple-maps

Is it possible to adjust the pin image size of annotation ti.map


I add the anntation like this

var annot= Map.createAnnotation({
        latitude: XXXXXXXXXXX,
        longitude: XXXXXXXXXX,
        title: 'myPlace',
        image: 'myPin.png',
        width:'100dp',// doesn't work
        height:'100dp'// doesn't work
    }); 
    this.mapView.addAnnotation(annot);
}

I would like to change the size of image though, there seems no way to change.

So I need to edit the file size itself by image editor or something. Moreover images are show differently in Android or iPhone. So I need to make two size for each pins.


Solution

  • MapModule.createAnnotation({
        latitude : XXXX,
        longitude : XXXX,
        customView : Ti.UI.createView({
            width : widthImg,
            height : heightImg * 2,
            children : [Ti.UI.createView({
                top : 0,
                width : width,
                height : height,
                backgroundImage : "myPin.png"
            })]
        })
    });