A set of extensions for polymaps
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
polymaps-extensions.js

README

===================
polymaps-extensions
===================

A set of extensions for polymaps http://polymaps.org, 
by Makina Corpus http://makina-corpus.com.

Overview
========

po.mcmap
--------
A map which automatically saves its state (zoom, location) using cookies.

    map = po.mcmap()


po.checkbrowser
---------------
A browser compatibility check for polymaps.

    po.checkbrowser("browser-fallback");

    <div id="browser-fallback">
      <h3>Your browser looks incompatible</h3>
    </div>


po.switcher
-----------
A layer switcher for polymaps.

    var layers = {
        "title1" : 
        po.image()
          .url(po.url("http://server1/{Z}/{X}/{Y}.png"))
          .id('layer1'),

        "title2" :
        po.image()
          .url(po.url("http://server2/{Z}/{X}/{Y}.png"))
          .id('layer2'),
    };
    po.switcher(map, layers, {title : 'Base Layer'})
      .container(document.getElementById("layerswitcher"));


    <div id="layerswitcher"></div>

po.toggler
----------
A layer toggler for polymaps.

    var layers = {
        "title1" : 
        po.geoJson()
          .url("http://polymaps.appspot.com/state/{Z}/{X}/{Y}.json")
          .id('state'),

        "title2" :
        po.image()
          .url("http://polymaps.appspot.com/county/{Z}/{X}/{Y}.json")
          .id('county'),
    };
    po.toggler(map, layers, {title : 'Vector Layers'})
      .container(document.getElementById("layerstoggler"));


    <div id="layerstoggler"></div>



Author
======
* Mathieu Leplatre <mathieu.leplatre@makina-corpus.com>