imhotep/MapKit — pull request #4 by lholmquist (2013-05-05 01:38:55+00:00)
Title: add icon customization.  set color or custom asset

This adds the .icon method to the pins.

currently you can adjust the color setting of the default icon

var pins = [
{
lat: 49.28115,
lon: -123.10450,
title: "A Cool Title",
snippet: "A Really Cool Snippet",
icon: mapKit.iconColors.HUE_ROSE
}]

mapkit.iconColors === the static values from BitmapDescriptorFactory

or you can use the fromAsset method

var pins = [
{
lat: 49.28115,
lon: -123.10450,
title: "A Cool Title",
snippet: "A Really Cool Snippet",
icon: {
type: "asset",
resource: "www/some_image_in_the_asset_directory.png"
}
},