![]() | Welcome to Islandnet.com Locally owned and operated since 1993 |
| Create an Account • Pricing & Features • Domain Registration • Customer Sites • Help & Info | |
Sunday May 18 2008 | |
Web Gadget: GeoMapGeoMap is a hit counter for your web site that tracks the latitude and longitude of each visit and displays a cluster map of the world to show where your visitors are coming from.
Current Version2007-08-01 10:48:02 NEWNote that you can check the version of a web gadget by loading it directly in your browser with the "version" keyword. For example, loading "geomap.php?version" will display the current version and tell you if there is a newer version available.
InstallationTo install this web gadget, place a copy of geomap.php in your web space. You can change the name to anything you'd like, as long as it ends with ".php". Note that this is an encoded and encrypted PHP file. It will look like gibberish to you, but the web server will know what to do with it. If you make any changes to this file it will cease to function, so be careful to upload it to your site in BINARY mode.You also need to place one of the map images from the end of this document into the same location as the geomap.php file.
ConfigurationWhen this web gadget runs it will expect to find a configuration file to load settings from. The filename depends on the name that you gave to the web gadget itself. If you named it "geomap.php" then the configuration file must be named "geomap_config.php" (that's an underscore in the middle). If you named it "feedback.php" then the configuration file must be named "feedback_config.php", and so on.The configuration file is a PHP script that contains a list of values in the "CONFIG" array. It will look something like this (but normally with many more settings):
Configuration Settings
Usage:This gadget can be invoked in several ways. If you simply load it directly in a web browser, it will default to an interactive mode where a map of the whole world is shown, and clicking on the continents will zoom in on them. The counter will not be incremented in interactive mode, it is meant for viewing the current GeoMap.To record hits and increment the counter, you'll want to embed a link to this gadget on one or more web pages on your site. This is generally done through the use of an image tag like this:
<img src="geomap.php?display=invisible&count=yes">Specifying "display=invisible" will cause the web gadget to output a 1x1 transparent GIF image (ie: it's invisible). The "count=yes" parameter causes it to increment the counter. If you prefer to actually display a map, you can use a link like this instead:
<img src="geomap.php?display=map&width=120&count=yes">The "display=map" option causes the gadget to output a world map with dots on it. The "width=120" parameter controls the width of the map in pixels. You can specify any value up to 1,440. For example, here's this site's GeoMap at 300 pixels wide:
<img src="geomap.php?display=map&width=300"> Of course, you can choose to display the map without incrementing the counter by leaving off the "count=yes" bit. You can display a particular continent by ading "area=XX" where XX is one of 'na' (North America), 'sa' (South America), 'eu' (Europe), 'af' (Africa), 'as' (Asia), or 'au' (Australia). For example, here's North America:
<img src="geomap.php?display=map&width=120&area=na"> You can also control the "clustering detail" to a degree by adding "detail=N" where N is a number from 0 to 10. The lower this number, the more distinct the hits will be, which generates more dots. As this number increases, hits that are close together geographically are merged together into a bigger dot, resulting in fewer overall dots. For example, here is a lower detail version of the image above:
<img src="geomap.php?display=map&width=120&area=na&detail=2"> Two additional optional parameters are "counter=yes" and "date="yes". If these are added, the current counter value is added to the top of the image, and the start date of the counter is added to the bottom. For example:
<img src="geomap.php?display=map&width=120&detail=2&counter=yes&date=yes"> And finally, here's some HTML you can cut and paste into your web site to display a GeoMap counter which is clickable (after installing and configuring a copy of GeoMap of course): <a href="javascript:;" onclick="window.open( 'geomap.php', 'geomap', 'height=500,width=645,resizable' ); return false;"> <img src="geomap.php?display=map&width=120&detail=3&counter=yes&date=yes" border="0" alt="" title="Click to view my GeoMap" style="border: 1px solid #000000"></a> If you add "count=yes" to the <img...> tag then it will also increment the counter value each time it's displayed.
Example:To view a working example, click here.To view the configuration file used in this example, click here.
Alternative Map Images:Copy one of these map images into the same directory as your geomap.php file and put the file name in the $CONFIG['MapImage'] setting. If you choose to supply your own map image, make sure that it is exactly 1440 x 720 pixels in size, and centered on 0' latitude, 0' longitude, just like these. Click on a map below to view/download the full size 1440 x 720 image:
|