EasyMap

The EasyMap API provides a simple, quick way to view Visual API overlays on a map. Here is a zoomable, pannable map of 2008 US Presidential Election results displayed using Bing Maps API:

This is useful for:

  1. getting a quick view of Mapfluence data
  2. configuring Visual API requests
  3. generating source code you can use and modify in your own applications

Constructing an EasyMap URL

Like a tile URL, an EasyMap URL uses Visual API Syntax.

In fact, to make a tile into a map, make two modifications to the URL:

  1. Change tile to map
  2. Remove the tile coordinates (but leave the map type)

These are the parts of a tile URL:

http://visual.mapfluence.com/   # host
tile/                           # request type
bg_color=ddd/                   # map globals
# layer definition:
    from=us_census00.state_geom|
    mode=simple|
    colors=ffcccc|
    border=faa_0.75/
tms/                            # map type
4/4/9.png                       # tile coordinates

tile image

The EasyMap URL for this tile is:

http://visual.mapfluence.com/   # host
map/                            # request type -- now 'map'
bg_color=ddd/                   # map globals
# layer definition:
    from=us_census00.state_geom|
    mode=simple|
    colors=ffcccc|
    border=faa_0.75/
tms/                            # map type
                                # tile coordinates -- removed

EasyMap Example

Map Types

To display the tiles with a different map API, just change the map type:

map type sample map
google Google Map
bing Bing Map
cloudmade Cloudmade Map
openlayers OpenLayers Map

Legends

If your map has a layer in class or theme mode, EasyMap can display a simple legend:

from=us_census00.county_geom|
mode=theme|
select=healthcvrg.uninsured.prt_u_1864|
breaks=0.05,0.09,0.13,0.17,0.21,0.25,0.29,0.33,0.37|
colors=skyblue,white,orange,red,black
?legend=true

Legend Map

Additional Parameters

You may specify the map's initial center and zoom by giving lat (latitude), lng (longitude) and zoom as arguments in the URL's query string.

With the following query arguments appended to the URL, this map centers on California:

?lat=37.0&
lng=-120.0&
zoom=5

Centered Map

To suppress legend display in all modes, use:

nolegend=true

Lastly, you can specify the size of the HTML div containing the map:

width=500&
height=200

Sized Div Map