OS OpenSpace [logo]

OS OpenSpace Forum » OS OpenSpace » Newbie Area

Thread: Real beginner help

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

Permlink Replies: 10 - Pages: 1 - Last Post: 20-Dec-2009 15:43 by: boilerbill
northwales

Posts: 2
Registered: 07/01/09
Real beginner help
Posted: 08-Apr-2009 17:54
  Click to reply to this thread Reply

Is there anywhere on the site that has a very simple, step by step guide for adding a lat/long to a map and then adding html info windows to number of markers.

I have copied and tried the basic 'displaying a marker on a map' code and as it is it works fine but no matter how I change the lat/long to my position, I still seem to stay in Southampton.

As you can tell, I do need a very basic guide..

ebygomm

Posts: 39
Registered: 03/04/08
Re: Real beginner help
Posted: 08-Apr-2009 19:08   in response to: northwales
  Click to reply to this thread Reply

Are you changing the set centre coordinates as well as the marker coordinates?

northwales

Posts: 2
Registered: 07/01/09
Re: Real beginner help
Posted: 08-Apr-2009 22:21   in response to: ebygomm
  Click to reply to this thread Reply

yes or at least i am trying to

3rdwashington

Posts: 2
Registered: 08/06/09
Re: Real beginner help
Posted: 08-Jun-2009 22:27   in response to: northwales
  Click to reply to this thread Reply

I havent even got that far- How do I get it onto my site?!

oxygenkiosk

Posts: 1
Registered: 26/07/09
Re: Real beginner help
Posted: 26-Jul-2009 19:56   in response to: 3rdwashington
  Click to reply to this thread Reply

I've used http://www.mapstraction.com/ to get me going

eg http://www.bangorcivicsociety.org.uk/pages/amap_os.html

3 PARTS

HEAD

<script src="http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=6F9E3CA8B4EEC15EE0405F0AF0606ECD"></script>
<script type="text/javascript" charset="utf-8" src="http://mapstraction.com/mapstraction-js/mapstraction.js"></script>
<script type="text/javascript">

function initialize() {
// initialise the map with your choice of API
var mapstraction = new Mapstraction('map_canvas','openspace');

// create a lat/lon object
var myPoint = new LatLonPoint( 53.22489490410034, -4.134378433227539);

// display the map centered on a latitude and longitude (Google zoom levels)
mapstraction.setCenterAndZoom(myPoint, 15);

mapstraction.addControls({
pan: true,
zoom: 'small',
map_type: true
});

}

</script>

BODY TAG

add onload="initialize()" so <body onload="initialize()">

BODY

and in a div tag

id="map_canvas" style="width: 100%; height: 700px"





just remember to relace the key with yours key=6F9E3CA8B4EEC15EE0405F0AF0606ECD

Message was edited by: oxygenkiosk

Message was edited by: oxygenkiosk

boilerbill

Posts: 12
Registered: 04/11/09
Re: Real beginner help
Posted: 20-Dec-2009 09:58   in response to: northwales
  Click to reply to this thread Reply

A complete dumbo now following in these footsteps!!

After struggling for some time I finally got this thread and tried copy/paste of the code suggested, including swapping my number for the one in the example.

All I got was http referrer not valid then the page opening up with the following:
BODY TAG add onload="initialize()" so BODY and in a div tag id="map_canvas" style="width: 100%; height: 700px"

The page is sat at http://www.duofratlodge.org.uk

Any help would be thankfully received.

Keith

boilerbill

Posts: 12
Registered: 04/11/09
Re: Real beginner help
Posted: 20-Dec-2009 10:22   in response to: northwales
  Click to reply to this thread Reply

Duh - typing and being called to breakfast - not good.

Webpage http://www.duofratlodge.org.uk/map.html

Keith

tonydunlop

Posts: 158
Registered: 16/05/09
Re: Real beginner help
Posted: 20-Dec-2009 11:19   in response to: boilerbill
  Click to reply to this thread Reply

For starters, to get valid html try replacing this:
BODY TAG add onload="initialize()" so BODY and in a div tag id="map_canvas" style="width: 100%; height: 700px"
by this:

</head>
<body onload="initialize()">
<d.i.v id="map_canvas" style="width: 100%; height: 700px"></d.i.v>

Make sure you take the dots out of the word div (twice) - I had to put them there otherwise the forum software treats this line as an html 'div' and it vanishes!

boilerbill

Posts: 12
Registered: 04/11/09
Re: Real beginner help
Posted: 20-Dec-2009 12:13   in response to: tonydunlop
  Click to reply to this thread Reply

Thank you for a prompt reply, especially on the Sunday before Christmas!

I have done as suggested and, indeed, got a step forward.

Now I still get the referrer error, but clicking through that I get a blank page rather than the failed script as before.

Keith

tonydunlop

Posts: 158
Registered: 16/05/09
Re: Real beginner help
Posted: 20-Dec-2009 13:25   in response to: boilerbill
  Click to reply to this thread Reply

Keith,

Your map page is displaying correctly for me now (in firefox 3.5.6) - it shows a map of Bangor.

I'm not sure what's preventing it working for you? Try refreshing the page.

Tony

boilerbill

Posts: 12
Registered: 04/11/09
Re: Real beginner help
Posted: 20-Dec-2009 15:43   in response to: tonydunlop
  Click to reply to this thread Reply

Well - I'll be.....

The **** thing is showing in IE 7 when I tried it on the Laptop, so I switched to Windows 7 and IE 8 on this machine from XP64 and Google Chrome and there it was again.

Seems like there is a problem between this lot and GC, ** hum.

Thank you for your assistance from a very excited BoilerBill (boilerbill.com).

Now just got to sort out my co-ordinates....

K

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