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
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).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.