viewAt.org API:

  1. How can I insert my panoramas uploaded to viewAt.org onto my web page?
  2. Integration of the panoramic locations on viewAt.org on the map of My webpage.
    1. Configuration parameters.
    2. Configuration variants.
    3. Dynamic activation of locations on the map.

1. How can I insert my panoramas uploaded to viewAt.org onto my web page?

You only need to know a little about HTML.

If the author of the panorama you wish to download has given his/her previous consent, you will see the exact code number you need to insert your panorama. This code is simply a fragment of the JavaScript wrapped in a box which you can give the dimensions you wish and modify other design parameters.

This is the code to be inserted:

<div style="width: 600px; height: 400px;"><script language="javascript" type="text/javascript" src="http://viewat.org/?sec=fp_ext&id=XXXX"></script></div></script></div>

If you want to centre the panorama horizontally:

<div style="margin: 15px auto 15px auto; width: 600px; height: 400px;"><script language="javascript" type="text/javascript" src="http://viewat.org/?sec=fp_ext&id=XXXX"></script></div></script></div>

If you want to use a specific language to show the panorama:

<div style="width: 600px; height: 400px;"><script language="javascript" type="text/javascript" src="http://viewat.org/?sec=fp_ext& id=XXXX&i=fr"></script></div></script></div>

This will show the panorama in French. Each language has an international code, for example, English (en), Spanish (es), Italian (it) etc... If no particular language is specified, the panorama will be shown in the language pre-determined by your browser or, by default, in English.

If you require more information about the styles of the box, click here .

If you have uploaded panoramas to viewAt.org, and you want to insert them on your webpage:

First: access your publication area to viewAt.org. In the list of your uploaded panoramas, under each one, you will see a link entitled "embed in my website". Click on this and you will open a window with the code that you must copy onto your webpage. If you wish, you can also specify if you want to let others insert your panorama onto their webpage (your name and the title will always appear) If you do not want others to use your panorama, for greater security, you should indicate which webpage or pages you plan to insert your panorama. In this way, viewat.org will block any attempt to show your panorama from any other site.

Secondly: copy the specified code and paste it onto the source code pf your webpage. If you have a weblog, paste it in the window of editing items. All you have to do now is save the changes.

2. Integration of the panoramic locations on viewAt.org on the map of My webpage

In the aim of letting a wider public know of the wonders of panoramic images of 180º and 360º we have set up a small API in order to integrate the viewAt.org locations on other web pages showing information in Google map format. The following is an example of how it works:

Link to HTML code here .

Using the function viewatExtMap() you can easily integrate the location of a determined area of the world on your map. To do this, you have to call up a file which contains the code which generates it: http://viewat.org/?sec=map_api&v=1 and then use the function viewatExtMap() with your map.

For example:

<div id="map" style="width: 500;height: 450"></div>

<script language="javascript" type="text/javascript" src="http://maps.google.com/maps?file=api&hl=en&v=2.x&key={ individual key }"></script>

<script language="javascript" type="text/javascript" src="http://viewat.org/?sec=map_api&v=1"></script>

<script type="text/javascript">
//<![CDATA[

if (GBrowserIsCompatible()) {

    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());

    map.setCenter(new GLatLng(0, 0), 1, G_HYBRID_MAP);

    new ViewatExtMap(map, 100, {spaceMap: "box"});

}

//]]>
</script>

2.1. Configuration parameters

viewatExtMap() requires the use of GMap2. It might not work well with the previous version of Google Maps.

viewatExtMap() requires the use of three basic parameters for its configuration. The first parameter refers to the object which contains the map, which is the variable where the call to GMap2 is constructed. The second parameter represents the maximum number of locations which need to be shown (there is a maximum limit of 125 locations per map) The third parameter of configuration is a series of options described below:

  • spaceMap:box/center/getBox where center is the default option.
    • center: shows the panoramas nearest the centre of the map.
    • box: shows the panoramas inside the map rectangle.
    • getBox: modifies the position and zoom of the map to adjust it to the total number of panoramas to be viewed.
  • hl: International language code. By default, the one sent by the internaut's browser.
  • author: view code by author. If you have already uploaded panoramas to viewAt.org, you will find more information about this option in your personal panel.
  • hidden:true/false where false is the default value. If it is active, (true) does not show the locations which have been loaded directly but waits for a function command show() of type viewatExtMap to activate them.

2.2. Configuration variants

Basic mode:
new ViewatExtMap(map);

A maximum of 25 panoramas will be shown spreading from the centre of the map:
new ViewatExtMap(map, 25);

A maximum of 25 panoramas will be shown within the map rectangle:
new ViewatExtMap(map, 25, {spaceMap: "box"});

A maximun of 50 maps will be shown in French:
new ViewatExtMap(map, 50, {hl: "fr", spaceMap: "box"});

Dynamic activation of panoramic views:
viewatExt = new ViewatExtMap(map, 50, {hidden: true});
viewatExt.show(); (activates the locations of the panoramas)
viewatExt.hidden(); (hides the locations of the panoramas)

2.3. Dynamic activation of locations on the map

The following example shows a Google Maps without directly showing the locations of viewAt.org although these are loaded in the background. The check up field is to activate/deactivate locations on the map:

Link to HTML code here .

This is a fragment of the HTML code which carries out the activate/deactivate function for viewAt.org locations on the map:

<script type="text/javascript">
//<![CDATA[

if (GBrowserIsCompatible()) {

    [...]

    viewAtObj = new ViewatExtMap(map, 100, {spaceMap:"box",hidden:true});

}

//]]>
</script>

<form>

<input type="checkbox" id="marks" name="check" value="visible"
       onClick="if (this.form.check.checked) viewAtObj.show(); else viewAtObj.hidden();">
<label for="marks"> Include viewAt.org markers</label>

</form>

Other languages: Español | Català | Français | Italiano | Português | Polski

Credits | Conditions of use | Contact | Stats