adding a custom overlay to a google map?

184 views
Skip to first unread message

Matt Price

unread,
Nov 7, 2011, 2:57:35 PM11/7/11
to timemap-d...@googlegroups.com
Hi,

Is it currently possible, in timemap, to add a custom overlay to a google map as described here in the google API docs?

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

If so, can you just point me to an example or the appopriate place in the doucmentation, and I will try to figure tis out myself?  thanks very much,

Matt

Nick Rabinowitz

unread,
Nov 7, 2011, 5:40:51 PM11/7/11
to mopt...@gmail.com, timemap-d...@googlegroups.com
Hi Matt -

If you're using Google Maps, you can do anything you'd normally do with the API by accessing tm.getNativeMap(). The Google v3 example shows this in practice, applying a Google-specific map style: http://timemap.googlecode.com/svn/tags/2.0.1/examples/basic_googlev3.html

You can access the map like this:

var tm = TimeMap.init({ ... });
var map = tm.getNativeMap();
// now use the map var as you normally would

The downsides of the native objects approach are a) it can be tricky to use the native objects with code that needs time data (i.e. hide/show based on current timeline position), and b) your code won't be portable to other map providers.

The other option, in this case, is to just use the timemap.js API to add an overlay (if it's just an image) - see the Placemarks example for syntax: http://timemap.googlecode.com/svn/tags/2.0.1/examples/placemarks.html .  Note that overlays added in this way aren't clickable on the map at this time, though I'd like to add this functionality eventually.

Let me know if you run into any issues.

-Nick



--
You received this message because you are subscribed to the Google Groups "Timemap.js Development" group.
To post to this group, send email to timemap-d...@googlegroups.com.
To unsubscribe from this group, send email to timemap-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/timemap-development?hl=en.

Matt Price

unread,
Nov 14, 2011, 10:13:04 PM11/14/11
to Nick Rabinowitz, timemap-d...@googlegroups.com
Hi Nick,

thanks so much for this, and I have finally put up a template for my students:
https://github.com/titaniumbones/Student-Timemaps/

The code is pretty heavily commented, and is mostly just stolen from you, though there are some css additions. 

Really appreciate all your efforts, this wouldn't have been possible for me without them! Thanks,
matt

Nick Rabinowitz

unread,
Nov 14, 2011, 10:55:04 PM11/14/11
to mopt...@gmail.com, timemap-d...@googlegroups.com
Cool! I've added it to the Sites Using Timemap page: http://code.google.com/p/timemap/wiki/SitesUsingTimemapJS

BTW, you might be interested in a recent digital humanities project I've been working on, called GapVis, that offers a visual interface for books about ancient places, using Timemap.js in part: http://nrabinowitz.github.com/gapvis/#index

-Nick

Dale Kunce

unread,
Nov 15, 2011, 2:14:43 AM11/15/11
to nick.ra...@gmail.com, mopt...@gmail.com, timemap-d...@googlegroups.com
Nick I love the GapViz site. I've been trying to figure out how to do something similar to your spoke and wheel overlays on the map, how did you do that? I was thinking about having the user click to overlay a kml link, but your way looks a lot more dynamic. Is it something that is fairly easy to implement once you have the links built up?

sent from my mobile device

Dale Kunce


Matt Price

unread,
Nov 15, 2011, 5:29:32 AM11/15/11
to Nick Rabinowitz, timemap-d...@googlegroups.com
ah, that's really pretty neat. I have a colleague trying to do something a little bit similar with an ancient Tibetan text, but her main conceptual questions are:
- what do you do with imaginary places?
- is there a way to represent both the geography we now accept as real, and the relationships between places described in the text?
- how do you use a timeline to map out temporal relationships that are not given precisely in your text?

Or, anyway, that's approximately it. Have you thought of any of these types of questions? any answers? 

I'll see if I can get her to subscribe to the list and posethese question herself, I'm sure she'd do a much better job.
Again, thanks much!
Matt

Nick Rabinowitz

unread,
Nov 16, 2011, 1:06:11 AM11/16/11
to Dale Kunce, mopt...@gmail.com, timemap-d...@googlegroups.com
Hi Dale -

If you look at the code, you can see that the spoke+wheel diagram doesn't actually use timemap - it's just a standard google map with the network connections overlaid. It's not all that hard - generally a two-step process, one for adding the places themselves and the next for the links - each with two endpoints, and then you can loop through them adding polylines. You can see the code for this here: https://github.com/nrabinowitz/gapvis/blob/master/app/views/BookPlaceMapView.js

-Nick

Nick Rabinowitz

unread,
Nov 16, 2011, 1:18:30 AM11/16/11
to mopt...@gmail.com, timemap-d...@googlegroups.com
Hi Matt -

Those are great questions, with no easy answers. I especially like your second question - I like the Peutinger Table (http://en.wikipedia.org/wiki/Tabula_Peutingeriana) as a great example of place relationships defined by a very different world-view. The best answer I can give for the first two questions is that you'd probably need to map out the conceptual geography yourself, and load custom map tiles - it's not a great answer, but I think there's a risk in presenting our present-day geographical data as the image of the world the writers of you text would have envisioned (a risk the GapVis team should probably look at more closely).

The question of ambiguous temporal relationships is a difficult one. Visualization in general deals poorly with ambiguity - more visualizations are characterized by hard lines and clear representations of specific data. The Timeline library has a "uncertain date" visualization with lighter-colored bars indicating a range (see http://www.simile-widgets.org/timeline/examples/monet/monet.html for some examples), but it's not fantastic. I think it's on the right track though - some kind of representation of general range seems like the right approach.

Not sure if that's entirely helpful, but the questions you pose are definitely tricky to address with standard visual approaches, and might require some thinking about alternatives -

-Nick
Reply all
Reply to author
Forward
0 new messages