Datasets as separate overlays in OpenLayers

83 views
Skip to first unread message

Ethan Gruber

unread,
Feb 19, 2013, 12:11:59 PM2/19/13
to timemap-d...@googlegroups.com
I have been trying to track down discussion on this particular issue, but it doesn't seem to have come up yet--

I have an array of datasets, some coming form a JSON service, some from KML.  I want the JSON dataset to appear by default and the KML datasets to be invisible by default.  Timemap seems to be conflating these separate datasets into a single overlay in OpenLayers called markers, and making them all visible by default.  I want to be able to check them on and off individually.  The closest example I can find is the freebase/artists example, but the layer checkbox is separate HTML.  Is it possible to display the datasets in the OpenLayers LayerSwitcher, or do I have to implement the HTML checkbox method from the example?  It's not a big deal if I have to change my code, but I want to be sure my initial goal isn't possible.

Thanks,
Ethan

Alan Leslie

unread,
Feb 27, 2013, 10:25:25 PM2/27/13
to timemap-d...@googlegroups.com
Hi Ethan

Apologies in advance for pointing you to my stuff  but could you have a wee look at www.alfi2fe.co.uk/EdSciTimemap.html. I have several datasets there. Most of them are loaded at start up but the activities dataset is loaded only when the check box is clicked.

Maybe I'm wrong but I reckon you could similarly arrange your datasets so that the JSON datasets are loaded on page load and that the KML datasets are loaded on demand.

If that is not close to what you want let me know and hopefully we can figure out between ourselves a way to get your desired results.

I work with OpenLayers quite a lot and from what I have seen, at best, you get a marker layer, a polyline layer and a polygon layer. A single timemap dataset may well span all of these.

Hope that helps.

Alan
Reply all
Reply to author
Forward
0 new messages