★ wanayoo — archive 1999 http://mapsonus.switchboard.com/doc/makemap.htmlNouvelle recherche | Portail wanayoo

Maps On Us Logo Directed Map Drawing

The Maps On Us Directed Map Drawing service lets you add Draw Map hyperlinks to your own Web pages. For example, you can use the image on your personal home page as a link to an interactive map of your home. You can also use any of the other images in our link to Maps On Us gallery.

Warning
We reserve the right to change this interface without notice, and/or withdraw this service altogether.

You can create links to two types of maps: static or interactive.

Interactive Maps

Linking to an interactive map involves passing the map definition via url arguments. The result is exactly the same as if you signed onto Maps On Us as an unregistered user and asked us to draw a map.

There are three ways to create such a url: by example, by address, or by latitude and longitude.

Interactive Maps: By Example

The easiest way to create the url for a map is to use our regular site to create the map you want, and then use the "Mail It" link to mail the map to yourself. The mail will give you a url that will recreate the map as you saw it, including all named addresses on the map, labels, scale, etc. You can then use that url as the anchor for your own ``map of'' link. Anyone who clicks on that link should see exactly the same map you created.

Warning: You may be tempted to use the url that your browser displays for the map page. That may work for a short time, but eventually that url will fail. The reason is that part of the information necessary to create the map lives on our server, rather than in the url that your browser displays. To reliably recreate the map you want, you must use the url provided by the "Mail It" service.

Interactive Maps: By Address

To draw a map of an address, use the following base url:

    http://SERVER-NAME/bin/maps-map/usr=~new/formName=mapsetaddr
where SERVER-NAME is the name of this server. Add to that some or all of the following fields as ``get-mode'' arguments:
AddrHnum=house number
AddrStreet=street name
AddrXstreet=cross street name
AddrCity=city name
AddrState=state name
AddrZip=zip code
AddrPickBest=0, 1, 2, or 3
AddrStreetLine=house-number street-name
AddrCityLine=city, state zip

State or zip code are required; the other fields are optional. You must encode special characters via the normal url encoding scheme: e.g., use + for a blank, and %## for non-alphanumeric characters. If we can match that address perfectly, we'll draw a map of it. Otherwise we'll present a page with an error message and/or various alternatives, and invite the user to pick one.

If you set AddrPickBest to something other than 0, we'll be more aggressive about picking a single match for the address. In this case, if we can't find a perfect match, we'll automatically use the best match, without asking the user. Higher values mean we'll be more aggressive:

AddrPickBest=1   Use the best entry whose street name matches.
AddrPickBest=2   If we can't find the street, give a map of the city or zipcode.
AddrPickBest=3   If we can't find the city or zip, give a map of the state.

If you're getting the address from a database and all you have is a ``street address'' field that doesn't separate the house number, then you can use the AddrStreetLine field instead of AddrHnum, AddrStreet, and AddrXstreet. We recognize formats such as 123 Main St, Main St & Central Av, or just Main St. Similarly, you can use AddrCityLine instead of AddrCity, AddrState, and AddrZip.

Interactive Maps: By Latitude and Longitude

To draw a map of a latitude & longitude, use the following url:

    http://SERVER-NAME/bin/maps-map/usr=~new/mapCentScale=lng,lat[,scale]?SelectItems=-
where lng and lat are the longitude and latitude as signed floating point values (negative values are West and South). The optional scale is the scale, in miles/inch. Note that when you specify the lat/long this way, you do not use any conventional get-mode arguments.

Examples Of Interactive Maps

  1. Click Here to draw an interactive map of 600 Mountain Ave, Murray Hill, NJ. That uses this url:
       http://SERVER-NAME/bin/maps-map/usr=~new/formName=mapsetaddr
          ?AddrHnum=600&AddrStreet=Mountain+Ave
          &AddrCity=Murray+Hill&AddrState=NJ
    
  2. specifies a detailed map via latitude & longitude. That uses this url:
       http://SERVER-NAME/bin/maps-map/usr=~new/mapCentScale=-74.40188,40.68423,.07?SelectItems=-
    
  3. Draw a map of an address:
        Street: 
          City: 
     
    
    That uses this html: <FORM ACTION="/old?u=http%3A%2F%2Fmapsonus.switchboard.com%2Fbin%2Fmaps-map%2Fusr%3D~new%2FformName%3Dmapsetaddr&y=1999" METHOD=POST> <PRE> Street: <INPUT TYPE=text SIZE=30 NAME="AddrStreetLine"> City: <INPUT TYPE=text SIZE=30 NAME="AddrCityLine"> <INPUT TYPE=submit VALUE=" Map It! "> <INPUT TYPE=reset VALUE="Clear"> </PRE> </FORM>

Static Maps

We also let you specify a page with a non-interactive map via the url. Specifically, we can

These maps can also have Directions To ... hyperlinks for selected places. When the reader follows one of those links, we will plan a route to the specified destination, from a starting point of the reader's choice.

Example Of A Static Map

How To Create Static Map-Drawing URLs

In a map-drawing URL, the map is defined by a set of parameters that follow the name of the Maps On Us map-drawing command. Each parameter is of the form keyword=value, and parameters are separated by slashes (/). The map-drawing command is:

    http://SERVER-NAME/bin/maps-makemap
where SERVER-NAME is the name of this server.

While there are a lot of parameters, most have reasonable defaults, so at first you can ignore most of them. The only required parameters are:

Remember that you must escape many non-alphanumeric characters in URLs. In particular, use %20 for a blank. Note: A plus sign (+) will not work; you must encode a blank as %20.

place=position;label-name;goto-name
This defines a place to be shown on the map. If you give several place= parameters, we will scale the map to show all of them. This parameter has three semi-colon (;) separated sub-fields.

The position specifies the place's location. We allow several formats:

For city or zip, we'll use our best guess for the center of that area.

The label-name gives a label to be drawn on the map. If this name is omitted or blank, we will label the map with the position specification. If this name is dash (-), we will not label the place on the map (i.e., the map will show the place, but it won't be labeled).

The goto-name gives a name to be used for a ``click for directions'' link that follows the map image. If this name is omitted or blank, we will use the label-name. If this name is dash (-), we will not create a ``directions'' link for this place.

mapTitle=title for map
An optional string to use as the ``Map Title.'' This is printed in the ``description box'' that's at the bottom of the map image itself. If you omit this argument, we'll infer a title from the other arguments.

pageTitle=title for page
An optional title that we'll put above the map, and use in the html page title.

units=mi|km
Whether you want the map in miles or kilometers.

minScale=minimum-scale-factor
Specify a minimum scale to be used when Maps On Us automatically selects the scale to fit all places on the map. For example, minScale=1.0 forces Maps On Us to draw a less detailed, large-area map, even if the places are close together.

centLL=longitude,latitude
Force the map to be centered on this longitude and latitude. These must be in signed fractional degree format, with the longitude first. Negative longitudes are West, negative latitudes are South. Note: You should not use centLL= together with place=. If you do, we will center the map on the centLL= coordinates, and we will not guarantee that all your places will be visible on the map.

scale=scale-factor
Force the map scale to be this value (miles/inch or km/cm). Note: This overrides the default scale, which is whatever is needed to show all place= parameters.

imgsize=width,height
msize=width,height
Use one of these to specify the map size, in pixels. The msize argument gives the size of the actual map itself. In this case the overall gif file will be slightly larger, because we'll put the scale and other information at the bottom. The imgsize argument specifies the overall size of the gif image. In this case the map part will be slightly smaller.

color=1|0
Whether you want a color map (1) or a gray-scale map (0).

ppi=pixels-per-inch
The resolution of your monitor, in pixels per inch (can be floating point). You only need this if you want the scale to be accurate as measured on your monitor (i.e., if the map's scale is 1.0 miles/inch, an inch on your screen will be a mile only if the ppi= parameter matches your screen's resolution).

Example

Here is the URL for the example given above. For readability, we've spread it over several lines:
   http://SERVER-NAME/bin/maps-makemap/msize=450,400
      /place=-74.16719,40.36528;Holmdel
      /place=-74.40180,40.68419;Murray
      /place=-74.41599,40.81833;Whippany
      /place=-74.17728,40.69130;EWR;Newark%20Airport%20(EWR)
      /pageTitle=Selected%20Places%20In%20NJ"

Defaults

Here are the current default values for the parameters which have defaults:
        units=mi
        msize=400,300
        minScale=.20
        color=1
        ppi=70

See Also


For comments for questions, please see our FAQ page.