Hi all,
I'm working on a project which allows users to mark areas of a map
with a drawing tool. The project is restricted to Europe and so I want
to communicate this to the user with a "fail" tile type thing for
areas outside of Europe. I've generated extent tiles (png tiles of my
study area) and I've recreated the Fail Tiles demo from here with no
problem:
http://gmaps-samples-flash.googlecode.com/svn/trunk/demos/CustomMapRoadTrip/CustomMapRoadTrip.html
So, now I get a fail tile where one of my extent tiles was not loaded
which is good. My problem is that my study area is not a rectangle and
some of my extent tiles are part white (outside study area) and part
black (within the study area). So far I've managed to use
bitmap.threshold in my ExtentTile class (modified from RoadMapTile.as)
to set the white area to another colour. For example, once the extent
png is loaded, this fires:
private function loaded(event:Event):void {
event.currentTarget.removeEventListener(Event.COMPLETE,
loaded);
var W:int=event.target.content.width;
var H:int=event.target.content.height;
extentBitmapData=new BitmapData(W,H,true, 0xFFFFFFFF);
extentBitmapData.draw(event.target.content);
//now set white areas to red colour to
indicate extent
extentBitmapData.threshold(extentBitmapData,new
Rectangle(0,0,W,H),new Point(0,0),"==",0xFFFFFFFF, 0x55FF0000);
extentBitmap=new Bitmap(extentBitmapData);
addChild(extentBitmap);
}
But what I want to do is set the white areas of the tile to an image/
bitmap/icon, rather than a colour. Essentially, I want to be able to
pass an image/bitmap into the threshold function to set the white
areas to an image. In pseudocode:
if (part of extent tile == white) then (apply image/bitmap fill to
white pixels) else (pixels are in extent, leave as transparent)
I hope that's clear. Has anyone come across this issue before? Is
there perhaps another approach to achieve the same functionality?
Thanks,
Julian
--
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en.