AvriHtmlMap

I was bored to draw all my html maps using photoshop in order to find more or less the good coordinate of my polys.
So I have created a small mooClass in order to draw the map directly on the image.
It's based on canvas & ofc mootools :)

Download AvriHtmlMap

download uncompressed

Exemple :

demo :

Syntax :

(Here is the php code which create the image loaded)

  1. <?php
  2. if (!isset($_FILES['image']) OR $_FILES['image']['error'] > 0)
  3. echo 'Select an image in order to draw the html maps :';
  4. else if ($_FILES['image']['size'] > 5000*12000)
  5. echo 'Erreur lors de l\'envoi. <br />Le fichier selectionné est trop volumineux. <br />Réduisez sa taille (en utilisant Paint par exemple).';
  6. else
  7. {
  8. $ext = strtolower(substr(strrchr($_FILES['image']['name'],'.'),1));
  9. if (!in_array(strtolower($ext),array('png','gif','jpg','jpeg')))
  10. echo 'Erreur lors de l\'envoi. <br />Extension incorrecte.';
  11. else
  12. {
  13. $fp = fopen($_FILES['image']['tmp_name'], "r");
  14. $content = fread($fp, filesize($_FILES['image']['tmp_name']));
  15. echo '<img id="img" src="data:image/jpg;base64,'.base64_encode($content).'" />' ;
  16. fclose($fp);
  17. }
  18. }
  19.  
  20. ?>