Integrating Mapfluence with your Application

Integrating with Mapfluence is easy. If you are a web developer, it's a simple path to use the Javascript API, and there are a boat load of examples in the Mapfluence Developer API Lab. If you are a desktop, mobile, or aerospace programmer, you can use the lab to learn how to structure requests to the web service endpoints, and then incorporate/build the URLs and request them from your native code.

Integrating with an existing website

To use the Javascript API:

<script src="http://spatial.mapfluence.com/js/api.js?apikey=<yourkey>" type="text/javascript" />

If you are using any Query API functionality, you'll need to address cross-site scripting and several options are described here.

Supported Web Mapping Frameworks

The Mapfluence Javascript API provides convenient tile managers for:

For other frameworks: if it supports tile overlays and TMS for 256x256 tiles, it can work with Mapfluence!

For advanced users, the example below skirts the Mapfluence Javascript API, and uses the tile web service directly:

<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Mapfluence Google Maps Overlay Demo</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAQTYYFizKoRRLtN2WJKDAZBSZIZ97IX8uIfHLyQNDz6alA2XMkhT08b0LJDl6RAqFatgVifS541nybQ" type="text/javascript"></script>
    <script type="text/javascript">
    var map;
    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setUIToDefault();

                map.setCenter(new GLatLng(37.76,-122.4), 11);

                var mapGlobals = "d";   // could do a 'bg_color=blue' here, e.g.
                var layerDef = "from%3Dus_census00.county_geom|mode%3Dsimple|colors%3Dclear|border%3Dblack_2";
                var apikey = 'MY_MAPFLUENCE_APIKEY';
                var tileLayerOverlay = new GTileLayerOverlay(
                  new GTileLayer(null, null, null, {
                    tileUrlTemplate: 'http://visual.mapfluence.com/tile/1.0.0/' +  mapGlobals + '/' + layerDef + '/g/{Z}/{X}/{Y}.png?apikey=' + apikey,
                    isPng:true,
                    opacity:1
                  })
                );

                map.addOverlay(tileLayerOverlay);
      }
    }

    </script>

  </head>

  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 650px; height: 330px; float: left"></div>

  </body>
</html>

Flash, Mobile, and Desktop Applications

The Mapfluence Javascript API in fact a simple convenience wrapper designed to properly marshal and escape parameters to the Mapfluence web services. One can easily replicate the requisite functionality in any language, and then make HTTP requests to the Mapfluence servers.

Tiles generated by the Visual API Tile web service conform to the TMS specification for 256x256 tiles. Any client supporting this system can render properly georeferenced images.