Synchronized Google Maps Query Parameters
Query parameters are attached to a web URL in order to change the way a web application is initialized . This page will discuss the query parameters for Synchronized Google Maps.
Query parameters are introduced at the end of a URL with a
question mark ?
character. Then each parameter is a
pair written as: key=value
The key
names the parameter and the value
gives its setting.
If there is more than one key=value
pair, then adjacent
pairs are separated by the ampersand &
character.
We will now describe each key and the possible values that may be provided.
Key: data
This key specifies a web path to a map location data file that will be used to populate the Select Location dropdown list. The parameter pair should have the form:
data=path
The data file format of a map location data file path
should adhere to the discussion in:
Synchronized Google Maps Data File Format
Browser security settings require that path
represent a path on the same web domain as the
Synchronized Google Maps web application.
If the data
parameter is omitted, then the default
path is mapspots.txt
. If no such file exists then
the dropdown menu will be made invisible.
It is also possible to use the data=
query parameter
to actively suppress the dropdown menu if that is desired. Here
is how this is done:
..../maps/index.htm?data=none
The parameter data=none
causes the maps application
to ignore all data files including mapspots.txt
.
The dropdown menu will be made invisible.
Aside:
As discussed on the Data File Format page, the data file may begin with an embedded default query string. We summarize that discussion here.
If the very first character in the data file is a question mark
character ?
, then the first line is treated as an
embedded default query string.
The processing rule is this:
If a query parameter is set in an embedded default query string and is not set in the regular query string on the URL, then this embedded query value will be used.
Thus, a regular query parameter dominates an embedded query parameter. Nevertheless, an embedded query parameter will prevail during initialization if that parameter is not set in the regular query string.
Key: start
The start
parameter selects the initial entry in the
Select Location dropdown menu.
The parameter should have the form start=...
where
...
represents that first few characters of some
location name in the mapspots data file. These characters must
be entered in a case-sensitive manner. If it is necessary to
enter several words, replace any blank with %20
.
Example
In the data file,
baseball.txt
,
there are two teams from New York:
New York Mets: Citi Field|40.75702|-73.84596
New York Yankees: Yankee Stadium|40.82952|-73.92643
The parameter start=New
will select the New York Mets since
that team occurs first in the data file.
To start with the New York Yankees, use start=New%20York%20Y
.
Reaching the second instance of Y
is sufficient to go past
the New York Mets and match the New York Yankees.
Key: lite
By default, the user controls at the top of the Synchronized Google Maps web application appear in what is called lite mode:
Notice that the check box Lite is checked by default. To see the full set of available controls, simply uncheck this box. You will then see:
If you prefer to see all controls immediately when the
Synchronized Google Maps opens then use a query
parameter lite=false
. Since it is so easy
to simply uncheck the Lite check box, this query
setting is not often used.
Key: ll
One may set ll=latitude,longitude
where
latitude
and longitude
are
floating point strings.
Since the latitude
should
be between -90
and 90
and
since the longitude
should
be between -180
and 180
,
these strings are normally written as signed decimal strings
with no separate exponent.
The ll
parameter is ignored if the string data cannot
be parsed into a valid pair of numbers.
Key: z
One may set z=zoomlevel
where
zoomlevel
is an integer string between
0
and 20
.
The zoomlevel
parameter is ignored if the
string data cannot be parsed into a valid integer that is
greater than or equal to 0
.
If the zoomlevel
parameter is parsed into
a valid integer but is greater than 20
, it is
reduced to 20
.
Key: m
One may set m=mapcount
to specify the
number of synchronized maps made visible
when Synchronized Google Maps is opened.
mapcount
must be
1
,
2
,
3
,
or 4
.
The default for mapcount
is 1
.
Keys: t1 t2 t3 t4
The keys t1 t2 t3 t4
set the default map types
for each of the synchronized maps
when Synchronized Google Maps is opened. These defaults
apply even if the maps themselves have yet to be made visible.
The values possible for these keys are single letters that stand in for the available maps types. We decided to support both the letters used by Google and alternate letters that may be easier to remember. These letter values are given in the table below:
Map Type | Alternate | |
---|---|---|
Road Map | m |
r |
Hybrid Satellite Map | h |
  |
Terrain Map | p |
t |
Satellite Map | k |
s |
The default initialization of map types was presented in the User Interface discussion via the diagram:
Road Map | Hybrid Satellite Map |
Terrain Map | Satellite Map |
If this default initialization were presented as part of a query string then that part would look as follows:
t1=m&t2=h&t3=p&t4=k
For comparison, in the file
baseball.txt
,
the first line is an embedded default query string:
?z=18&t1=h&t2=m&start=Boston
You may see that this embedded default query string has the effect of switching the default map types for map 1 and map 2 to Hybrid Satellite Map and Road Map respectively.