Suggested framework for web application that will give users directions
I'm starting to work on a web application that will utilize Dijkstra's algorithm to find users the fastest directions for point A to point B. I'm just wondering if anyone has any suggestions for a framework for this? I was leaning towards something involving PHP, but I'd really prefer to not build my own framework as that开发者_开发问答 seems overkill.
I'm only being given some images to work with, does anyone have suggestions for how I'd draw a line from point A to point B?
I don't know if you're really looking for a PHP framework (like CodeIgniter or Symfony) or just for PHP library for image manipulation. Framework are useful to manage your whole application, dealing with users management, permission, data storage, etc... If your looking to just manipulate images, a Library should do the thing.
My first app I did to manage a map was in plain PHP using the GD library (usually installed with your version of PHP). Documentation available here : http://php.net/manual/en/book.image.php
Quick small example to draw a line on an existing picture with GD :
// Create image from existing jpg
$image = @imagecreatefromjpeg('map.jpg');
// Draw a red line from X1 = 10, Y1 = 10, X2 = 20, Y2 = 20
$red = imagecolorallocate($image, 255, 0, 0);
imageline($image , 10 , 10 , 20 , 20 , $red);
You can do a lot of things with GD, it just takes time to be used to.
精彩评论