1

I want to make user able to draw routes and areas on static images as it is done on Google Maps. I've never done any JavaScript drawing before. Please advice me:

  1. Any library/plugin who can help me to draw editable polylines and polygones on static images (and make it able to store the lines/points on my server)

  2. What is the common way to draw for most browsers? As I know the "canvas" tag isn't supported enough by many browsers, and to make a line using multiple DIVs wouldn't be the best way to achieve this.

  3. Is it possible to attach Google Maps API to a static picture?

Thank you!

Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
LINQ2Vodka
  • 2,996
  • 2
  • 27
  • 47
  • Try these suggested libraries: http://stackoverflow.com/questions/96486/javascript-drawing-library – Sprintstar Oct 28 '11 at 10:37
  • i believe google maps API can help you with everything. you can click on the map to save the waypoints (or input the addresses using a form on your page) and have the API to trace the route for you. – RASG Oct 28 '11 at 10:53
  • RASG: is that possible to use google API on my static images? I mean, would it be hard to attach it's functionality for my purposes? Also, doesn't it violate any agreement? Thanks. – LINQ2Vodka Oct 28 '11 at 11:14
  • hmm... you might be right about the agreement violation. about the API, as long as you save the address/coordinate in an array when the user clicks on your image, you can pass this array to the API. – RASG Oct 28 '11 at 11:48

1 Answers1

0

Look into the Google Maps "GroundOverlay" object

http://code.google.com/apis/maps/documentation/javascript/overlays.html#GroundOverlays

This should allow you to lay your static image on top of the map, while keeping all of the map's regular functionality (infowindows, polylines, routes, etc).

SteamDev
  • 477
  • 4
  • 4