Reply to comment

Adding a scale

The following will add a scale to the map:

Below the line where it says

map.addControl(new GSmallMapControl());

Add this code:

// adds a map scale to the lower left corner
map.addControl(new GScaleControl());

Also, I think a few of us would like to be able to see the terrain or the aerial view. To do this, add the following lines to the code after where you INSERT IGNOREed the scale:

// adds map type control to upper right corner
map.addControl(new GMapTypeControl());

// adds the terrain option to the map type control
map.addMapType(G_PHYSICAL_MAP) ;

To see the map in action with these changes, go to http://www.charlesdietrich.com/TourDivide/google1.html

View the source to get the fully commented code for the map.

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <b> <i> <br /> <br> <hr> <hr /> <p> <div> <abbr>
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.
MTBcast SPOT