OS OpenSpace [logo]

OS OpenSpace Forum » OS OpenSpace » Newbie Area

Thread: Real Dumbo trying to do a marker

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

Permlink Replies: 9 - Pages: 1 - Last Post: 08-Jan-2010 10:26 by: ianholt
boilerbill

Posts: 12
Registered: 04/11/09
Real Dumbo trying to do a marker
Posted: 20-Dec-2009 17:17
  Click to reply to this thread Reply

Thanks to tonydunlop I now have a working map attached to the duofratlodge.org.uk site (from the where we meet page)

However, being greedy I have been tying to attach a marker and again fallen flat on my face.

The attempt is sat at http://www.duofratlodge.org.uk/map2.html is any kind person cares to look and tell me where I have made a fool of myself.

TIA
Keith

OS OpenSpace Team

Posts: 1,112
Registered: 31/01/08
Re: Real Dumbo trying to do a marker
Posted: 21-Dec-2009 16:16   in response to: boilerbill
  Click to reply to this thread Reply

Hi 'boilerbill'

If you have a look at the support page on the OpenSpace website there is a demo which includes a code snippet for adding a marker. Please see http://openspace.ordnancesurvey.co.uk/openspace/support.html

If you select the add a marker link on the right side of the map screen and then scroll down the page you will see the code that you need to allow you to do this.

I hope this helps?

Kind regards

Tamsyn
The OpenSpace Team

iain

Posts: 58
Registered: 21/07/09
Re: Real Dumbo trying to do a marker
Posted: 21-Dec-2009 20:38   in response to: boilerbill
  Click to reply to this thread Reply

Hi boilerbill

I haven't used mapstraction myself but I'm guessing that where you have 'osMap.addLayer' you should have 'mapstraction.addLayer'.

Cheers

Iain

tonydunlop

Posts: 158
Registered: 16/05/09
Re: Real Dumbo trying to do a marker
Posted: 22-Dec-2009 09:35   in response to: boilerbill
  Click to reply to this thread Reply

... and the javascript code to add the marker should be within the initialize() function (i.e. before the } ).

boilerbill

Posts: 12
Registered: 04/11/09
Re: Real Dumbo trying to do a marker
Posted: 01-Jan-2010 14:23   in response to: boilerbill
  Click to reply to this thread Reply

Thanks for the comments and a happy new year to you all.
Sorry for he delay, Christmas duties sadly intervened.

I have done one modification, I think, but the javascript in the initialise () function ie., before the } has got to me. Could you please explain further for a novice and oblige?

TIA
Keith

tonydunlop

Posts: 158
Registered: 16/05/09
Re: Real Dumbo trying to do a marker
Posted: 01-Jan-2010 16:55   in response to: boilerbill
  Click to reply to this thread Reply

At the moment you have a line containing just the } character that is above a line beginning:
var markers

You should move the line containing } so it is immediately above the line:
</script>

boilerbill

Posts: 12
Registered: 04/11/09
Re: Real Dumbo trying to do a marker
Posted: 02-Jan-2010 14:31   in response to: boilerbill
  Click to reply to this thread Reply

Done (I think) but still not getting the pin (though it is needling me instead ;-))
K

tonydunlop

Posts: 158
Registered: 16/05/09
Re: Real Dumbo trying to do a marker
Posted: 02-Jan-2010 17:43   in response to: boilerbill
  Click to reply to this thread Reply

Hi Keith,

As has been mentioned before on these forums, mixing OpenLayers and OpenSpace methods (as your javascript is doing) can be tricky, and is best avoided by beginners. Okay, you can display the basic map, but as soon as you attempt anything else like adding a marker, that's when the trouble begins.

If I were you I would wipe the slate clean and start with the OpenSpace examples for the Basic Map and Adding a Marker on the OpenSpace 'Support' pages (as suggested by the OpenSpace team in a previous post). These examples don't use OpenLayers directly which is appropriate for beginners.

Even better, why not try the new Web-Map builder service that came on-stream today at http://openspace.ordnancesurvey.co.uk/openspace/webmapbuilder.html

Tony

Message was edited by: tonydunlop

boilerbill

Posts: 12
Registered: 04/11/09
Re: Real Dumbo trying to do a marker
Posted: 07-Jan-2010 22:26   in response to: boilerbill
  Click to reply to this thread Reply

I have tried that and 'lost' the thing at the save bit, appears that I should have done something with the question mark in the beginning (see my comment on that group).
Now all I get is 400 bad request when I try and log back into it.

Not the easiest of sites to work with

Keith

ianholt

Posts: 10
Registered: 01/05/09
Re: Real Dumbo trying to do a marker
Posted: 08-Jan-2010 10:26   in response to: boilerbill
  Click to reply to this thread Reply

Hi Keith,

As others have said, this is a good example to start from:
http://openspace.ordnancesurvey.co.uk/openspace/example1.html

It creates a basic OpenSpace map with a marker.

( BTW You'll need to make sure the API key is correct for your site)

You can then work backwards and see if this can be used with mapstraction
(I don't have any personal experience)

If you are still stuck, PM me.

Thanks,
Ian (OpenSpace team)

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