PDA

View Full Version : Simple Map Plugin for FP


Vincent Ogloblinsky
05-25-2009, 11:21 AM
Simple Map Plugin for FPP

This is a simple map plugin to geolocate one panorama.

Here is a screenshot of the plugin:

http://img231.imageshack.us/img231/2616/sanstitreoz9.jpg

The plugin is free available at this adress with a demo: http://www.photoglob.fr/?p=503

And here is the settings to install and configure it.

UPDATE of 01-02-09:

- possibility to change the default button icon with an external png file, named map.png, at 55x55px and placed in the same folder than the map.swf
- possibility to show/hide the button: the function external.umap.visible = 0 or 1; do that well, check point 6 under.


1. put the map.swf file on your server, in a specific folder, ./files for example , if you use after GOOGLE for tiles provider, you need to add 3 others files copyright.php , settings.xml and GoogleLogo.png in the same folder than the swf.

2. in the FPP config xml file, add this line:
layer_5 = ./"my folder"/map.swf
that’s give
layer_5 = ./files/map.swf

3.add this xml node:

<Umap>
lat=48.8655
lng=-2.98605
loc_name = Bréhat (22) - France
align = BM
xoffset = 0
yoffset = 0
tooltip = Geolocation
provider = GOOGLE
maptype = hybrid
mapzoom = 14
</Umap>

YOU NEED to respect this order for the parameters, I didn’t get the time to code some security scripts if the parameters are not in this order.

The 2 frist parameters are for the geographic point.

The next loc_name is to indicate a name for you location, and will appear at the top-left of the map.

The parameter align give the possibility to place the icon around the corners of the player, it is the same than FPP:

TL: top-left
TM: top-middle
TR: top-right
BL: bottom-left
BM: bottom-middle
BR: bottom-right

The parameters xoffset and yoffset are here to do some positioning according to the needs.

The parameter tooltip is here to modify the tooltip which appear when the mouse cursor over the icon.

The parameter provider give the possibility to switch between many tiles providers: 4 providers are available:
- GOOGLE
- YAHOO
- MICROSOFT
- OPENSTREETMAP

The parameter maptype give the possibility to change the map type for the chosen provider:

- GOOGLE:
+ plan
+ satellite
+ hybrid
+ relief

- YAHOO
+ map
+ hybrid
+ satellite

- MICROSOFT
+ road
+ aerial
+ hybrid

- OPENSTREETMAP
+ mapnik
+ osmarender
+ cyclemap

The last parameter specify the final zoom for the map, between 0 and 17, by default at 10.

4. add these two functions in the global node of the hotspots plugin, for those who wants to do others actions during map loading:

load_map = '

'
close_map = '

'


5. for those which need to move the icon, you can use the two xoffset and yoffset as this:


loadMain = '
loadPano(panoName=images/pano,1000);
onTransitionEnd=moveIcon();
'

moveIcon = '
external.umap.xoffset = 50;
'

6. those who wants to show/hide the button can do that with the function external.umap.visible = 0 or 1; in the next exemple we hide the button at the beginning of the panorama, and show the button at the end of tiles loading:

onStart = 'external.umap.visible = 0;loadPreview();'

loadPreview = '
pano.qualityStatic=low;
loadPano(panoName=images/small/pano,300);
onTransitionEnd=loadMain();
'

loadMain = '
loadPano(panoName=images/pano,1000);
onTransitionEnd=movePano();
'

movePano = '
pano.qualityStatic=high;
external.umap.visible = 1;
'

Some users report me that their map show a blank rectangle during their tests. You need to test your panorama on a webserver, on your webhoster or in a local view with <a href="http://www.mamp.info/en/index.php">MAMP </a>for Mac or <a href="http://www.easyphp.org/">Easyphp </a>for Windaube.

You can make a donation if you want

I will not develop more features for this plugin, another exist and it is more powerful and i invitate users interested to have a look on it, it is GMap Widget For FPP (http://www.davxmedias.com/smartvrcontroller/), from Davx Medias (http://www.davxmedias.com/)