Location: PHPKode > scripts > worldlocator > worldlocator/example2.php
<TITLE>Testing World IP Locator: Showing a map image</TITLE>
<span style='font-size: 20px;'>Testing World IP Locator: Showing a map image</span><br>

	// Note: If you have downloaded this files from PHPClasses, you probably haven't the required image files, and you'll get an error. Go to http://phpspain.hexoplastia.com/projects/worldlocator to download a full packet with the required images.

	include "worldlocator.inc.php";
	// Creating worldlocator object
	$worldlocator = new worldlocator;
	// This class could act in different ways, this example shows how to embed an <img> tag wich show a map with your location marked. See other examples.php.
	// Querying our address and controlling possible errors
	if (!$worldlocator->query (""))
		echo $worldlocator->geterror ();
		// If there are no errors ...
		// embed_image puts and <img> tag in your code wich points to worldlocator_imagegenerator.inc.php, this script composes and image with a map using GD, and marking your query result on the map.
		// Syntax: $worldlocatorobject->embed_image  (<map name:[day|night>, <marker name:[circle|arrow]>, <CSS Style definition for the IMG tag>);
		// There are two maps and two markers bundled with this distribution, but your can easily add more, see worldlocator.inc.php for more info on how to do this.
		echo $worldlocator->embed_image ("day", "arrow", "border-style: dashed; border-width: 1px;");


Return current item: worldlocator