I'm not using any html content tags to load my images. I use the
custominfowindow option to use my own image for the box and it is a
simple issue of loading the images with the loader class and adding
them to my window object movieclip. I am using Flash, but loader is
just as accessible in flex. From the research ive done, custom
infowindows are much better in flex than in flash thanks to flex's
awesome components. This guy made a nice class for custom infowindows
that will be more than you need im sure
http://www.rsmacfarlane.com/4th-year-project/how-to-create-your-own-custom-infowindow-with-google-maps-api-and-flex
var i:Marker = new Marker(
latlng,
markerOptions
);
i.addEventListener(MapMouseEvent.CLICK,
function(event:MapMouseEvent):void
{
var il2:XMLList = map_xml.location;
var iloc2:XMLList = map_locXml.location;
var user:Number = userId;
var hasGreenActions = false;
var imageLoader:Loader = new Loader();
for (var j:Number = 0; j < il2.length(); j++){
var popUp:popup_mc = new popup_mc;
var infoWindowOptions:InfoWindowOptions = new
InfoWindowOptions();
infoWindowOptions.customContent = popUp;
//trace(j);
trace("3. "+ userId);
popUp.action1_txt.type =
TextFieldType.DYNAMIC;
popUp.action1_txt.width = 650;
popUp.action2_txt.width = 650;
popUp.name_txt.width = 650;
popUp.closeWindow.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void
{
map.closeInfoWindow();
}
....looping xml
imageLoader.load(new URLRequest("mysite"+
userId +".jpg"));
imageLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,
noUserImage);
function noUserImage(e:Event):void
{
trace("no image loaded");
imageLoader.load(new
URLRequest("myblankavatar"));
}
popUp.userImage.addChild(imageLoader);
map.openInfoWindow(event.latLng,
infoWindowOptions);
On Aug 9, 5:24 pm, Austin <[email protected]> wrote:
> Hello. I am having problems trying to determine how to display local
> images in either an infowindow or a GOverlay. I currently have about
> 20 markers on my map, each with unique infowindows. However, I now
> need to display images with these markers somehow. My optimal goal
> would be to have the images georeferenced as a ground overlay, however
> I believe that adding the images in the infowindow will be a good
> starting point.
>
> I have come across many, many threads where people are asking about a
> similar issue. However, all the responses refer to using an html with
> contentHTML in the infowindow options. I need to mimic this idea, but
> with LOCAL images. I can not express that enough. :)
>
> I have tried making the images a part of my XML project and made sure
> they are in the same directory as my swf. I have even tried using the
> photo's relative path and still to no avail. Here is the simplest
> example the segment of my code for the simplest attempt at loading an
> image to the infowindow:
>
> var markerB:Marker = new Marker(
> new LatLng(29.038691, -80.906290),
> new MarkerOptions({
> fillStyle: new FillStyle({color: 0x223344, alpha: 0.8}),
> hasShadow: true }));
> markerB.addEventListener(MapMouseEvent.CLICK, function (e:Event):void
> {
> markerB.openInfoWindow(new InfoWindowOptions({contentHTML:<img
> src='example.jpg'/>,
> width: 300,
> height: 120}));});
>
> With this coding, when I click on the marker, the resized infowindow
> appears, but is empty. Can someone please help with how I can make
> this happen? Or if someone has input on using an image overlay that
> does not use a URL loader. Again, I would be trying to overlay a
> local image in the project folder.
>
> Thanks for any help!
--
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.