Jump to content

Need help with PHP Map click


davefootball123

Recommended Posts

Hi everyone, im creating a map and currently have it set up that on click...the x and y coordinates show up...here it is http://www.southernontariochasing.ca/environmentcanada.php

Now what I need is on click...those x and y coordinates be links. As you can see...there are multiple counties on the map and I would need  to set the coordinates for each county link...for example 1 county would be between the set xy...if the user clicks there...go to that link. Probably sounds very complicated...but any help would be great.

 

<form action='' method=post>
<center><input type="image" alt=' Finding coordinates of an image' style="position:absolute;left:50%;margin-left:-397px; 

margin-top:30px" src="ECmap.png" border="0" 
name="foo" style=cursor:crosshair;/>
</form>
<?php include("ecwarnings.php");
$foo_x=$_POST['foo_x'];
$foo_y=$_POST['foo_y'];
echo "X=$foo_x, Y=$foo_y ";?>

Link to comment
https://forums.phpfreaks.com/topic/267487-need-help-with-php-map-click/
Share on other sites

Image map is the easiest but if you want to go the xy route then you could do it with a copy of the map where each county is a unique solid colour. Using the GD imagecolorat($i, $x, $y) would give you the colour and therefore the county (with an array that tells you yellow is Windsor etc).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.