Welcome to SP!  -   
 
 MbPost.com -- It's SP for Mountain Biking!
Areas & Ranges·Mountains & Rocks·Routes·Images·Articles·Trip Reports·Gear·Other·People·Plans & Partners·What's New·Forum

 Forums Home > General > Thread

google maps tool

[ Start New Topic | Reply to This Topic ] All times are GMT  Pages: 1, 2  
 Author Topic: google maps tool
mattyj


Joined: 07 Aug 2006
Posts: 95


[ Profile | PM ]
PostPosted: Thu Sep 10, 2009 1:23 am GMT  Quote
 
The ability to overlay multiple map types with varying transparency has existed with Google Maps for some time now, but the only applications I've seen have been to drop the opacity of the background layer to make a poly shape - like a gps track - stand out better.

I created a page at

http://mattj.net/overlaymap.html

that allows you to mix and match two different layers with variable opacity. As you scroll, zoom or change layers, the URL is constantly updated, so at any point you can bookmark the URL, cut and paste it into an email, etc. It's a fun toy to play with but viewing satellite and topo imagery on top of each other or relief-shaded satellite images also has practical applications. Check out the following examples:

bay area, satellite w/ shaded relief:
http://mattj.net/overlaymap.html#center=37.82497195707114,-122.288818359375&zoom=9&base=Ter&overlay=Sat&opacity=0.5

regional park trails w/ shaded relief:
http://mattj.net/overlaymap.html#center=37.82314142578527,-122.17650890350342&zoom=15&base=Ter&overlay=OpenStreetMap&opacity=0.5

rainier, shaded relief satellite:
http://mattj.net/overlaymap.html#center=46.864885961378874,-121.77177429199219&zoom=11&base=Ter&overlay=Sat&opacity=0.5

yosemite valley topo w/ satellite
http://mattj.net/overlaymap.html#center=37.74173863896063,-119.57588195800781&zoom=14&base=MyTopo&overlay=Sat&opacity=0.5

Even though the URL updates, it's a standalone webpage with no server-side component, so you can save the HTML file locally and run it that way as well.

I'm sure this has been done before but I couldn't find any examples of it. Enjoy!
dyusem


Joined: 18 Feb 2009
Posts: 87


[ Profile | PM ]
PostPosted: Thu Sep 10, 2009 3:40 am GMT  Quote
 
Very cool...thanks for sharing!
Day Hiker


Joined: 26 Dec 2003
Posts: 2747


[ Profile | PM ]
PostPosted: Thu Sep 10, 2009 7:37 am GMT  Quote
 
Nice job. I worship your skills!
WouterB


Joined: 11 Jan 2008
Posts: 2696


[ Profile | PM ]
PostPosted: Thu Sep 10, 2009 8:19 am GMT  Quote
 
Nice, very nice!
Moni


Joined: 12 Aug 2002
Posts: 2106


[ Profile | PM ]
PostPosted: Thu Sep 10, 2009 2:25 pm GMT  Quote
 
SWEET!

Any chance that one could change datums as well as grid systems (I prefer using UTM and occasionally need NAD27 rather than NAD83/WGS84)?
mattyj


Joined: 07 Aug 2006
Posts: 95


[ Profile | PM ]
PostPosted: Thu Sep 10, 2009 6:09 pm GMT  Quote
 
Getting UTM is easy, it's just a question of finding a javascript library with suitable open licensing terms (I'd rather not redo all the math by hand). I have a version locally that puts up UTM, but I'm still trying to find the original source so that I can make sure I'm not violating someone's copyright if I throw it up on my site.

Datums are probably harder; I'm still a little hazy on how assuming different ellipsoid shapes for the earth affects a polar coordinate system like lat/long.

I just checked, and all the major browsers except IE support ungodly long URL strings. I'm going to add the ability to place markers / routes, but it will all take a while as I'm going to be in the Sierra a lot over the coming weeks. At the end of the day, I'd rather be climbing than coding.
nartreb


Joined: 03 Apr 2004
Posts: 1360


[ Profile | PM ]
PostPosted: Thu Sep 10, 2009 6:50 pm GMT  Quote
 
Very cool. My favorite so far is a 60-40 blend of Google terrain and USGS topo. I also very much appreciate the direct URL feature (with no extra step needed), and the fact that mouse coordinates are displayed and constantly updated. However, the coordinates can be very hard to read, despite a good choice of color. Can you make them bold, and/or put a mostly-opaque white background underneath them?

I would use this instead of Acme Mapper if it also had the ability to add markers. I don't need fancy GPS tracks, I just want to be able to email somebody a link and say "park at marker A, camp at marker B, ford the river at marker C". OK, more realistically, "park at marker A, leave the trail at B, the best bouldering is at C"
mattyj


Joined: 07 Aug 2006
Posts: 95


[ Profile | PM ]
PostPosted: Thu Sep 10, 2009 11:33 pm GMT  Quote
 
Okay, so I updated the tool to display UTM, made the coordinates more readable, and added markers. Right-click to create a new marker, right-click on a marker to delete it. Markers aren't draggable; you have to delete one and create another.

Remember that if you add too many markers your links may not work right in IE.

Example of Mt Rainier showing markers in action:

http://mattj.net/overlaymap.html#center=46.82273412957074,-121.73675537109375&zoom=13&base=Ter&overlay=Sat&opacity=0.5&markers=[{%22lat%22%3A46.83553581454299%2C%22lng%22%3A-121.73297882080078%2C%22title%22%3A%22Camp%20Muir%22}%2C{%22lat%22%3A46.84892147080043%2C%22lng%22%3A-121.74066066741943%2C%22title%22%3A%22Dissapointment%20Cleaver%22}%2C{%22lat%22%3A46.852913038414286%2C%22lng%22%3A-121.76040172576904%2C%22title%22%3A%22Summit%22}%2C{%22lat%22%3A46.803467133767704%2C%22lng%22%3A-121.72971725463867%2C%22title%22%3A%22Panorama%20Point%22}%2C{%22lat%22%3A46.78613268980293%2C%22lng%22%3A-121.73606872558594%2C%22title%22%3A%22Paradise%22}]
Day Hiker


Joined: 26 Dec 2003
Posts: 2747


[ Profile | PM ]
PostPosted: Fri Sep 11, 2009 7:03 am GMT  Quote
 
mattyj wrote:
Okay, so I updated the tool to display UTM, made the coordinates more readable, and added markers. Right-click to create a new marker, right-click on a marker to delete it. Markers aren't draggable; you have to delete one and create another.

Remember that if you add too many markers your links may not work right in IE.

Example of Mt Rainier showing markers in action:

http://mattj.net/overlaymap.html#center=46.82273412957074,-121.73675537109375&zoom=13&base=Ter&overlay=Sat&opacity=0.5&markers=[{%22lat%22%3A46.83553581454299%2C%22lng%22%3A-121.73297882080078%2C%22title%22%3A%22Camp%20Muir%22}%2C{%22lat%22%3A46.84892147080043%2C%22lng%22%3A-121.74066066741943%2C%22title%22%3A%22Dissapointment%20Cleaver%22}%2C{%22lat%22%3A46.852913038414286%2C%22lng%22%3A-121.76040172576904%2C%22title%22%3A%22Summit%22}%2C{%22lat%22%3A46.803467133767704%2C%22lng%22%3A-121.72971725463867%2C%22title%22%3A%22Panorama%20Point%22}%2C{%22lat%22%3A46.78613268980293%2C%22lng%22%3A-121.73606872558594%2C%22title%22%3A%22Paradise%22}]


You can solve part of the link-length problem if you can limit the coordinates to the fifth decimal place (1/100,000 of a degree), which is about one meter of resolution. Any GPS will be less precise than that. And if it's intended to be used primarily for large-scale views, you could even just use four or three decimal places, depending on the scale, without any real loss in functionality.
WouterB


Joined: 11 Jan 2008
Posts: 2696


[ Profile | PM ]
PostPosted: Fri Sep 11, 2009 7:53 am GMT  Quote
 
This is getting better and better! I hope you'll one day find the time to incorporate some EU topos.
MoapaPk


Joined: 13 May 2005
Posts: 4569


[ Profile | PM ]
PostPosted: Fri Sep 11, 2009 10:12 am GMT  Quote
 
Nice!
moonspots


Joined: 19 Jun 2006
Posts: 101


[ Profile | PM ]
PostPosted: Fri Sep 11, 2009 12:42 pm GMT  Quote
 
mattyj wrote:
The ability to overlay multiple map types ...I created a page at

http://mattj.net/overlaymap.html ...Enjoy!


Excellent work. Very Happy

I have NO idea how one goes about doing this. Confused

Fine job, thanks,

Dave
mattyj


Joined: 07 Aug 2006
Posts: 95


[ Profile | PM ]
PostPosted: Fri Sep 11, 2009 4:27 pm GMT  Quote
 
Day Hiker wrote:
You can solve part of the link-length problem if you can limit the coordinates to the fifth decimal place (1/100,000 of a degree), which is about one meter of resolution. Any GPS will be less precise than that. And if it's intended to be used primarily for large-scale views, you could even just use four or three decimal places, depending on the scale, without any real loss in functionality.


It's on my to do list, but I want to do a bit of testing first. Currently, I'm not tracking the lat/long for the markers separately; I'm telling google to place a marker at a certain location and then reading back the lat/long to construct the URL.

I don't know why they'd build it this way, but if Google is translating the lat/long into a pixel location on the screen and then back again when I read it, truncating the position could cause the marker to wander over time. Unlikely, but I want to check up on it before truncating the coordinates.
mattyj


Joined: 07 Aug 2006
Posts: 95


[ Profile | PM ]
PostPosted: Fri Sep 11, 2009 4:34 pm GMT  Quote
 
WouterB wrote:
This is getting better and better! I hope you'll one day find the time to incorporate some EU topos.


Do you know of any good sources? I'm not actually hosting any of the files themselves; rather, there's two common ways of naming image files that a lot of other mapping sites use, and I'm just pulling those images in. One involves specifying a bounding lat/lng and image dimensions in pixels (e.g. Terraserver), the other involves starting with the whole globe and doubling the number of tiles per axis each time you zoom in, e.g. start with 1 tile for the whole globe, then 4 tiles, then 16, etc (Google, MyTopo, Openstreetmap). Images are named in a standard format using the zoom and then the x and y coordinates for the tile.

If there are non-US sources that use either of these protocols, they're easy to pull in.
lavaka


Joined: 29 Apr 2002
Posts: 18


[ Profile | PM ]
PostPosted: Fri Oct 16, 2009 4:49 am GMT  Quote
 
Hi Matt,
It's a great tool! Thanks very much. Here are a few things I would love to see:

(1) I zoomed in on a popular mountain like Mt Whitney, and the USGS data isn't aligned with Google's data (fortunately in this case, the MyTopo data is well aligned). For cases like this, would it be possible to add a tool that lets the user add an x and y offset to the overlay layer, to allow manual re-alignment?

(2) Summitpost has some really nice google maps -- like for the Mountain Range pages, they show you all the mountains in that group. So there are some things that would be nice:
(2a) (this is unrelated to your site) is it possible to make a hack that lets someone save these to their own google "My Maps"? I checked the google maps API and can't find a way
(2b) Would it be possible to integrate these maps to your setup? Looks like you just scrape the info from the "createMarker" commands.
(2c) Is it possible to save a map from your site to the google "My Maps". Or... export it as a KML file?

(3) With your map tool or any google map, it's sometimes nice to save a map for printing (e.g. with a screen shot). With google maps, there's a quick hack that let's you save a much larger area than the current screen. You just go to "Link" button, and copy the text from the "Paste HTML to embed in website" box and save it in your own html file. Edit that html file and modify the "width" and "height" parameters to a larger value, and then open your html file in a browser. There are firefox plugins, like "screengrab" and "fireshot" that allow you to copy the entire image beyond what's visible in the window.

So, would it be possible to do this using your setup? i.e. add a "Link" link, or tell us how to alter the URL (e.g. http://mattj.net/overlaymap.html#center=X,Y&zoom=14&base=Sat&overlay=MyTopo&opacity=0.7&width=1200&height=900 )

Anyhow, I'm sure this isn't your top priority, but if you have time to make improvements, these are my suggestions. Thanks again for this service!

-Stephen
Display posts from previous:   
[ Start New Topic | Reply to This Topic ] Pages: 1, 2  


 
Jump to:  




© 2006 SummitPost.org. All Rights Reserved.