Using ImportShapeLayerData and Custom Icons
I have a layer of pushpins that is working fine but I am uncertain of how to change the icons for these pushpins.
Should it be stored in the XML or is it set globally for the layer?
-Chris
I have a layer of pushpins that is working fine but I am uncertain of how to change the icons for these pushpins.
Should it be stored in the XML or is it set globally for the layer?
-Chris
There's a thread that discusses this here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1692076&SiteID=1
In particular, I've posted up a general guideline on how to do this here:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1664041&SiteID=1
Hope that helps,
hrmmm... Just out of curiosity is there some limitation to how many push pins that should be used with a regular VEShape call?
I have about 100 pushpins so far to map but there could be alot more than that.
I'm lost as to what has to happen in the Callback function...
Here's what I have:
function drawPins()
{
var existingLayer = new VEShapeLayer();
var veLayerSpec = new VEShapeSourceSpecification(VEDataType.GeoRSS, 'url', 'existingLayer');
existingLayer.Hide();
map.ImportShapeLayerData(veLayerSpec, onFeedLoad, 1);
existingLayer.Show();
}
function onFeedLoad()
{
Shape.SetCustomIcon(Shape.IconId);
}
I know the callback isn't right I don't think...
Try something like this:
function onFeedLoad(layer)
{
layer.Hide();
var numShapes = layer.GetShapeCount();
for(var i=0; i < numShapes; ++i)
{
var s = layer.GetShapeByIndex(i);
s.SetCustomIcon("<div class='pin'></div>");
}
layer.Show();
}