OS OpenSpace [logo]

OS OpenSpace Forum » OS OpenSpace » Application Gallery

Thread: Where is the path demo

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 34 - Pages: 3 [ 1 2 3 | Next ] - Last Post: 07-Oct-2009 17:34 by: chadwickBill Threads: [ Previous | Next ]
Guest
Where is the path demo
Posted: 09-Feb-2008 10:39
  Click to reply to this thread Reply

I have made what I believe is a useful web page for the UK outdoors community (hikers, mountain bikers, horse riders, climbers ... ).

It uses OS mapping and Google imagery to enable the route of a path, track road or street on the OS mapping to be located on the imagery and vice versa.

There are no adverts on the page. I do not think it significantly promotes the business of Google. So I believe it is within the spirit of the OpenSpace Developer Agreement.

A similar solution could be engineered with OS imagery if the OpenSpace API included it. 1:25K mapping would be good too.

Here is the basic link

http://wheresthepath.googlepages.com/wheresthepath.htm

and here is a link to the Scafell Pike area

http://tinyurl.com/yv3tya

EYDramblers

Posts: 8
Registered: 05/02/08
Re: Where is the path demo
Posted: 17-Feb-2008 23:06   in response to: Guest
  Click to reply to this thread Reply

Hi Bill,

I have found your application very useful and there is a link on our web site to a modified version (markers with pop-ups added to the OS pane at the location of open access sites in part of the Yorkshire Wolds). The feedback from several of our members has been very positive. The direct link is http://tinyurl.com/2w4u6h.

If the OS were to make available the map showing open access land (CRoW), ie the Explorer series, the Open Space project would be even more useful for walkers.

Regards,

Tom Halstead

Guest
Re: Where is the path demo
Posted: 18-Feb-2008 12:30   in response to: EYDramblers
  Click to reply to this thread Reply

I suggest you refetch my code as I tidied it up over the weekend (Openlayers bug-arounds to ensure blue boxes always show on Firefox + map controls next to each other).

You may be able to get CROW data from http://www.magic.gov.uk/

I got Mendip SSSI data from there and made a custom Google map layer from it - see http://www.bdcc.co.uk/mendip.html.

Guest
Re: Where is the path demo
Posted: 22-Feb-2008 23:30   in response to: Guest
  Click to reply to this thread Reply

On http://wheresthepath.googlepages.com/wheresthepath.htm you can now
draw a track and drag its nodes around on both maps at once

I hope that this side by side Google + OpenSpace demo might help
others who know GMaps and want to get going with OpenSpace.

On OpenSpace, little things - like dragging a Marker, popping up an
InfoWindow require an amount of tedious research reading the OpenSpace
and OpenLayers code. The docs on both the OS WebSite and
openlayers.org are very poor compared to Google's GMaps.

Oh and the combination of vectors and opening InfoWindows on OpenSpace
makes for some horrendous flickering on Firefox - slightly less bad on
MSIE but then the InfoWindow shadows are too dark ...

Guest
Re: Where is the path demo
Posted: 24-Feb-2008 22:23   in response to: Guest
  Click to reply to this thread Reply

Flickering not quite so bad now.

hoddy

Posts: 1
Registered: 11/03/08
Re: Where is the path demo
Posted: 11-Mar-2008 16:24   in response to: Guest
  Click to reply to this thread Reply

great idea.

any way you could incorporate the marker points into the url when you press the 'link' button - this would be useful for sharing a route with people .

chris

Guest
Re: Where is the path demo
Posted: 16-Mar-2008 11:38   in response to: hoddy
  Click to reply to this thread Reply

I Hope one day to do something for sharing routes with Google Spreadsheet/Forms/Data.

I Suspect that trying to use the URL might be inappropriate for a complex route.

fonant

Posts: 16
Registered: 05/02/08
Re: Where is the path demo
Posted: 22-Mar-2008 22:51   in response to: Guest
  Click to reply to this thread Reply

Licensing-speaking, sharing your route publicly would be allowed if you "traced" the Google map, but not if you "traced" the OS map. For the latter the points would be a derivative work, and you would need a license (probably just a Paper Map Copying License) to share with the world.

Quite how this all fits with modern free online mapping, APIs side-by-side, etc. I really don't know...

JohnColeman

Posts: 11
Registered: 17/03/08
Re: Where is the path demo
Posted: 23-Mar-2008 18:15   in response to: hoddy
  Click to reply to this thread Reply

Re any way you could incorporate the marker points into the url when you press the 'link' button: See the links I posted in th OpenViewer thread.

Message was edited by: JohnColeman

Guest
Re: Where is the path demo
Posted: 25-Mar-2008 09:08   in response to: fonant
  Click to reply to this thread Reply

Is selecting a sequence of paths, tracks and roads that form an interesting route creating a 'severable improvement' (Developer Agreement para 4.4)?

I have added GPX export to wheresthepath. I will be surprised and disappointed if the OS ask me to remove it.

Personally I don't care that much if the OS want to claim ownership of a route that I create using their data and then load to my personal GPS device (para 4.5 I believe gives users a license to use 'derived data').

The Developer Agreement does not contain the word route or track or 'GPS'.

Perhaps the OS team would like to comment about how route creation and sharing via the web fits with in with the Developer Agreement.

fonant

Posts: 16
Registered: 05/02/08
Re: Where is the path demo
Posted: 26-Mar-2008 22:31   in response to: Guest
  Click to reply to this thread Reply

From my investigations: If the route is "traced" from the OS mapping, then it's a derivative work. If the route was traced from the OS mapping, then your GPX export might just require special licensing. But if the route is instead traced from the Google mapping, it wouldn't. Whether using the OS mapping as a visual guide to tracing from the Google mapping makes it a derivative work, or not, I'm not sure. Probably hinges on how the two are linked...

Perhaps OpenSpace will soon disallow the display of OS and Google mapping side-by-side in the same web page?

What about using a paper OS map, to locate things, and Google's web site to digitise the route?

OS's licensing is out-dated and needs changing. Perhaps we can help them to set the boundaries as to what is allowed and what isn't...

chadwickBill

Posts: 390
Registered: 07/02/08
Re: Where is the path demo
Posted: 29-Mar-2008 00:23   in response to: Guest
  Click to reply to this thread Reply

Perhaps I worded my previous post a little harshly for the OS. The point I was trying to make is that if I make a route using OpenSpace and load it to my own GPS device then I am happy for the OS to consider the IP of the route to belong to them and for them to grant me a no-cost license to use it in my GPS.

bobosola

Posts: 19
Registered: 13/03/08
Re: Where is the path demo
Posted: 03-Apr-2008 23:45   in response to: Guest
  Click to reply to this thread Reply

> On OpenSpace, little things - like dragging a Marker,
> popping up an InfoWindow require an amount of tedious research
> reading the OpenSpace and OpenLayers code.

Bill, OpenSpace is certainly great stuff, but it could hardly be more minimally documented. It's like unix man pages - great if you already know the model and just want a quick syntax check, but next to hopeless if you are new to the whole thing. I am trying to do something like your mouse click route plotter without just copying your code directly. Could I ask you where you got the info from to do this stuff? Which classes to use, etc? I'm finding it a real struggle to find out not only how to do things, but what is actually possible. If I can't find any docs, is it OK to use suitable bits of your code (I would only want the OS stuff, not Google).

Regds,
Bob Osola.

chadwickBill

Posts: 390
Registered: 07/02/08
Re: Where is the path demo
Posted: 04-Apr-2008 08:31   in response to: bobosola
  Click to reply to this thread Reply

Go ahead and clone whatever you want. Sorry the Google and OS stuff is so mixed up. I am afraid that the code has evolved over the weeks and is not very well organised - write once code just for me :(

There are two snippets of code from openlayers forum that make the marker drag work - the class OpenLayers.Handler.Marker and OpenLayers.Control.DragMarker. Include these two earliy in your page code, or perhaps in a separate js file. I put a very quick hack into DragMarker to temporarily inhibit drag using a global variable bDontDrag. This should of course be done with an enable/disable method on .DragMarker.

Adding Markers is done in function plotClick which takes a Google GLatLng and an OpenSpace MapPoint. In this function bTracing indicates edit mode, bTracking indicates edit or add mode. Events for OpenSpace markers , click mouesover and mouesout are added in PlotClick.

Markers are linked into a list by adding .pred and ,succ properties to them. I have also maintained an array of markers with appropriate operations on marker insert and delete. I think you could probably omit this (.splice stuff on osTrackMkrs) - simply keep the first node in a variable and always iterate the collection with the .succ property (see clearTrack) . I put the markers info window size in added property .iwSize and its html in .html.

function moveOsMkr is the drag handler for an OS Marker. I had to use a timer on dragEnd (doneOsMkr) to stop unwanted click events at the end of the drag (variable osDragging).

linkOsMarkers is the bit that adds lines between the markers and recalculates the html. bearingBetween and distanceToString are helpers for the html generation.

setOTrackXYs must be done whenever a marker is added or moved. It works out the x,y coords for the code that moves the trace marker X (edit insert point) along the route.

It would be good to combine the add and edit modes into one with a click on the X marker being required to insert a node and a click off it appending a node. I got this going on Google but could never get the X marker click on OS. Also some 'Undo' would be good.

Hope this helps a bit.

chadwickBill

Posts: 390
Registered: 07/02/08
Re: Where is the path demo
Posted: 04-Apr-2008 11:28   in response to: chadwickBill
  Click to reply to this thread Reply

A bit more of the recipe.

When creating your map use code like this to omit the keyboard navigation which
can mess things up.

osMap = new OpenSpace.Map('osMapDiv', { controls: [] });
osMap.addControl(new OpenLayers.Control.Navigation());//Omit keyboard navigation control
osCpyC = new OpenSpace.Control.CopyrightCollection();
osMap.addControl(osCpyC);
osLmPos = new OpenSpace.Control.ControlPosition(OpenSpace.Control.ControlAnchor.ANCHOR_TOP_RIGHT);
osLmC = new OpenSpace.Control.LargeMapControl();
osMap.addControl(osLmC, osLmPos);

You must add the DragMarker control after adding the Marker layer thus. The onDrag and onComplete handlers get passed the marker object that is being dragged.

markers = new OpenLayers.Layer.Markers("Markers");
osMap.addLayer(markers);

DragControl=new OpenLayers.Control.DragMarker(markers,{ 'onDrag': function(m){moveOsMkr(m);}, 'onComplete': function(m){doneOsMkr(m);} });

osMap.addControl(DragControl);

DragControl.activate();

-> Andy, I think the OpenSpace code should add MarkerDrag functionality.

Legend
Expert: 51 - 1000 pts
Advanced: 31 - 50 pts
Intermediate: 16 - 30 pts
Novice: 5 - 15 pts
Newbie: 0 - 4 pts
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums