PDA

View Full Version : Embedding Google Maps into FPP


miplap
06-13-2007, 10:14 PM
I have been working on a few ideas recently, trying to understand how to work with Flash and FPP.
Here's an example that embeds Google Maps and an Apple-style panorama selection into a virtual tour.
http://www.vrblogger.co.uk/?p=15
It's still work in progress but shows the possibilities and power of using FPP for the delivery of virtual tours.
There seems to be an issue loading the map image in Internet Explorer. I will look into this.
What I need to understand now is how to read parameters from XML so that the markers can be added dynamically. Any help??
Regards
Mark

kevin
06-14-2007, 02:28 PM
Great work Mark,

I was thinking about this too, I have used Google maps in the past, I am working with Greybox + Google map + and Flashpano on a project right now (I'm just starting):

http://reslife.uvm.edu/virtualtour/

I love your iTunes selection - would you be willing to share how you did that? (the iTunes that is, I know the Google map needs some more work)

--Kevin

jaaaab
06-14-2007, 04:02 PM
awesome!

just so bad there's a conflict using the mousewheel!

++

miplap
06-14-2007, 04:35 PM
Thanks jaaaab & kevin,

The double effect of the mouse wheel is an irritation that I only discovered just now myself!!

As for the iTunes-style selection, I used the Flow List Flash component from AFComponents (all links are in my blog post). It's not too expensive and does exactly what I wanted. I took the code from the FPP controller example and added this to a sample project from Flow List. I use an XML file to list the thumbnail images.

I'll add the Flash project to my blog post later.

I will definitely look at greybox too ... it seems to do what I also have on my list of things to do!! Presumably, it's like lightbox?

Cheers

Mark

kevin
06-14-2007, 07:24 PM
Mark,

Greybox, litebox, thickbox...etc. They are all similar. Sometimes I am doing something and I get some conflicts, so I try another one! They are each implemented a little differently, but do the same things. Greybox I find quick and easy to use and there are a few display options - so I like it.

kevin
06-14-2007, 07:25 PM
Mark,

Greybox, litebox, thickbox...etc. They are all similar. Sometimes I am doing something and I get some conflicts, so I try another one! They are each implemented a little differently, but do the same things. Greybox I find quick and easy to use and there are a few display options - so I like it.

barbi
11-29-2008, 10:25 PM
I would like to use the ideas described in the first post, so I created an fla based on the infos there. The major difference is that it loads all data from an xml file. Click on the large i-spot, it loads the google map and click any of the two markers to load a pano. It loads the pano, however I cannot load another panorama again if I click on the marker. I don't understand what causes this error. Besides I would also like to send the name of the xml file to the google maps fla as a parameter, but don't know how to do it (the google maps component is in AS2!)

Link to the partially working gmap: http://rapidshare.com/files/168698221/gmap.zip.html

Joro
11-30-2008, 09:28 AM
weird. i dont see the map in you example when i click on the button, just the google scroll. vista and mff 3.0.4 . cheers

barbi
11-30-2008, 04:00 PM
Yes and getting weirder.
So the map is not displayed on your computer since it is not allowed to download web content from an swf file by default. Double click the swf file and allow it to access web content using a macromedia site.

I was trying to use UMAP today since it has much more features, and the result is that if I call the loadPano function (see below), it works fine, but if I call the loadPanoXml, it will only load at first. I definitely need the XML version. After a bit of debugging it turned out that setSlot() is called by FPP only at first and not called after the first transition. Any ideas how to continue?

import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
import flash.utils.*;

var slaveSlot:String;
var panoBusy:Boolean;
var panoName:String;
var timer:Timer;
var masterSlot:String;

var controllerName:String = "lc_test";
var dumpSlot:String = controllerName + "_dump_" + Math.random();

var _lc:LocalConnection = new LocalConnection();
_lc.allowDomain("*");
_lc.connect(dumpSlot);
_lc.addEventListener(StatusEvent.STATUS, onStatus);
_lc.client = this;
_lc.send(controllerName + "_master_0", "getSlot", dumpSlot);

function sendQuery(param1:Event)
{
_lc.send(masterSlot, "getParams", ["pano.panoName", "pano2.panoName"], slaveSlot, "callback");
}

function callback(values)
{
panoName = values[1] != null ? values[1] : values[0];
}

function onStatus(param1)
{
if (param1.level == "error")
{
trace(param1.toString());
/* trace("No master connection detected.");
_lc.close();
_lc = null;*/
}
}

function loadPano(name)
{
trace (name);
if (masterSlot != null)
{
_lc.send(masterSlot, "execute", "loadPano(panoName=" + name + ");");
}
}

function loadPanoXML(name)
{
trace (name);
if (masterSlot != null)
{
_lc.send(masterSlot, "execute", "loadPano(xml_file=" + name + ",1000,stripes);");
}
}

function setSlot(param1)
{
masterSlot = controllerName + "_master_" + param1;
slaveSlot = controllerName + "_slave_" + param1 + "_" + Math.random();
_lc.close();
_lc.connect(slaveSlot);
trace("set slave: " + slaveSlot);
startWatch();
}

function startWatch()
{
timer = new Timer(500);
timer.addEventListener(TimerEvent.TIMER, sendQuery);
timer.start();
}

Joro
12-01-2008, 05:54 PM
@barbi: did u make it work? cos i was trough all that code and i think it should work...and idk why its not lol. and i ll try to find a solution, cos it is just bugging me, but if you find one first, please post it here :D will make my sleep better for sure :)

barbi
12-02-2008, 07:46 AM
Yes, I got it working but using externalinterface