The world’s largest Online Nautical Guide with information on more than 8500 Marinas

Luxury Travel Guide Awards 2017
Select language

PortBooker Widget HOWTO


The Widget implementation is based on five steps. First of all you need to have a \"pbApi key\", that we will provide you. Please contact us if you don’t have this key. Contact

  • This is a complete example of how to use the Widget API.

    Example:

    <script type="text/javascript" src="http://www.portbooker.com/widget/portbookerApi.js"></script>
    <script type="text/javascript">
       registerWidget("475a6f4e81496cda4d77dca90e528415");
       setLogoPosition('bottom');
       setLanguage('en');
       setBackgroundColors('FFFFFF','F7F7F7','F7F7F7','F0F0F0');
       setWidth(750);
       setHeight(750);
       createWidget('widget');
    </script>

    If you need further information about these functions please review the Widget API: Widget API

  • Once portbooker.com have sent you the pbAPI key, you must introduce it in the function registerWidget(\"\");

    Example:

    registerWidget("475d6f7c81406cda4d77dea90e528415");

  • You have to facilitate the domain from where you execute the widget

    Example:

    If your widget is executed from http://www.tudominio.com/widget.html , you will have to facilitate:www.tudominio.com

  • We must ensure that we have a DIV where we can introduce the widget in our web. Then the DIV ID must go to the function: createWidget('widgetDIV'); para especificar donde estará ubicado el widget.

    Example:

    <div id=\"widget\"></div>"; ?>

    createWidget('widget');"; ?>

  • To define the Initial View you will have to provide the data according to SW (South-West) and NE (North-East) coordinates. To obtain those values you can execute the application of coordinate selection application of coordinate selection

    Example:

    setInitialView(16.29905101458183, -27.421875,67.7427590666639, 68.5546875);

  • Activate the geographical restriction, and adds the list of countries to the visible items. There are two types of geographical restriction scopes, by country and by zone, and both can be activated simultaneously by calling his respective method. Countries are defined using codes

    The zones names and location for each country can be found at http://www.portbooker.com/en/marinas-map/ entering in each country you can see in the left the list of zones, and in the map his location. The zone code can be located inside the URL where point each zone name link (for example in Greece, the link where points Dodecanese zone is , translate("así que el numero 35 es el identificador de zona."); ?>

    Example:

    addCountryRestriction('es,it,de,fr,us');"; ?>

    addZoneRestriction(\"53,54,55\");"; ?>

  • You may use the following banner to create a link to our widget on your website:
    banner_widget

Please contact us if you want to ask for a Portbooker nautical guide widget

Your data