Problem:
I want the user to be able to click on a US map to find the product dealers in their state. Most of the states are not nice uniform rectangles. California, for instance, is a pretty complex polygon. I know how to sense the loction of the cursor and I know how to determine if the cursor position is within a certain boundry (in_array) and I know how to set an array of numbers (range()) that will work for rectangular states.
Is ther a function similar to range() that will allow me to set a range that is a poloygon or do I need to break down more complex shapes into rectangles?
<?php
$xcursor_position = $POST[test_x];
$ycursor_position = $POST[test_y];
$xrange = range(1,20);
$yrange = range(45,74);
if ((in_array($xcursor_position, $xrange)) && (in_array($ycursor_postion, $yrange))){
$msg = "Welcome to Northern California";
} else {
$msg = "Sorry";
};
?>
Thanks,
Gordon