|
This section covers some more advanced topics. MouseOver Popups
Starting with GMapEZ 2.2, you can have a little popup show up when
the user's mouse rolls over the marker. The popup can only have
text, unlike info windows which
can have any HTML. Add a <div class="GMapEZ" style="width: 300px; height: 300px;"> <a title="4D Development" href="http://maps.google.com/maps?ll=41.092104,-85.144740&spn=0.006130,0.009795&t=k&hl=en"> </a> <a title="New York" href="http://maps.google.com/maps?ll=40.755580,-73.937988&spn=6.276505,5.552490&hl=en"> </a> <a title="Chicago" href="http://maps.google.com/maps?ll=41.877741,-87.637939&spn=6.169597,5.552490&hl=en"> </a> <a title="Los Angeles" href="http://maps.google.com/maps?ll=33.916013,-118.179932&spn=6.874500,5.552490&hl=en"> </a> </div> Note that different browsers may display the popup quite differently. For example, Opera puts the word "Title:" in front of the text you provide. Specifying an extent
In some situations you may want to specify a default zoom level or pan
position that is different than what GMapEZ automatically chooses for
you. To do this, go to maps.google.com, drag
the map to the area you want to display, set the map type, the zoom
level, etc. Now click "Link to this page" and copy the URL into your
<div class="GMapEZ GSmallMapControl GSmallMapTypeControl"
style="width: 300px; height: 300px;">
<a href="http://maps.google.com/maps?ll=51.890054,-98.613281&spn=41.589263,80.239746&t=h&hl=en">
EXTENT
</a>
<a href="http://maps.google.com/maps?ll=41.092104,-85.144740&spn=0.006130,0.009795&t=k&hl=en">
</a>
<a href="http://maps.google.com/maps?ll=40.755580,-73.937988&spn=6.276505,5.552490&hl=en">
</a>
<a href="http://maps.google.com/maps?ll=41.877741,-87.637939&spn=6.169597,5.552490&hl=en">
</a>
<a href="http://maps.google.com/maps?ll=33.916013,-118.179932&spn=6.874500,5.552490&hl=en">
</a>
</div>
So in this example, I decided to use the Hybrid map type and to make
Canada visible even though there are no markers in Canada. The map
type used in the EXTENT link will be used for your map, unless you
override it with a ZOOM links
<div class="GMapEZ GSmallMapControl GSmallMapTypeControl"
style="width: 300px; height: 300px;">
<a id="hq" href="http://maps.google.com/maps?ll=41.092104,-85.144740&spn=0.006130,0.009795&t=k&hl=en">
A
</a>
<a id="chi" href="http://maps.google.com/maps?ll=41.877741,-87.637939&spn=6.169597,5.552490&hl=en">
C
</a>
</div>
Before GMapEZ 2.3, links to markers would only
open an info window and cause the map to pan. Now by adding a
<a href="#hq" class="ZOOM">Zoom in to 4D</a> or <a href="#chi" class="ZOOM">Zoom out to Chicago</a>
The link in the targeted marker is interpreted exactly like an extent. If the targeted marker is followed by
a Using multiple API keys
Some web pages are available from different URLs, such as localhost
for testing, with and without a leading "www.", etc. In these cases,
the Google API keys can be a pain. GMapEZ helps by letting you
specify different keys for different URLs. The default key is
specified as described previously. Note
the <meta name="gmapkey" content="abcdefg" />
To specify a key for a particular URL, you can give part of that url
(the pattern) in the <meta name="gmapkey:localhost" content="hijklmn" /> <meta name="gmapkey" content="abcdefg" />
You can give as many different keys as you want. The order matters,
though -- the first pattern that matches the page's URL is the one
that will be used. If none of the patterns match, the key given with
To be standards-compliant, all
The patterns given in these Drawing lines
You may add lines to your map by adding one or more
Here is a slightly more complicated example:
<div class="GMapEZ GSmallMapControl GSmallMapTypeControl G_SATELLITE_TYPE"
style="width: 300px; height: 300px;">
<ol class="color:#00ff00 weight:3 opacity:0.6">
<li><a href="http://maps.google.com/maps?ll=41.564259,-85.852840">
OPEN GREEN START
</a>
<div>Start here</div></li>
<li><a href="http://maps.google.com/maps?ll=41.565314,-85.850486">
</a></li>
<li><a href="http://maps.google.com/maps?ll=41.563443,-85.849449">
ORANGE END
</a>
<div>End here.</div></li>
</ol>
</div>
This example includes
In this example I used the optional
Note that inside |
Copyright 2008 by Chouser, all rights reserved.