Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


XHTML, CSS - How can I solve this problem?

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

pwntifex
World Chat Champion



Joined: 23 Aug 2006
Karma :

PostPosted: 23:44 - 06 May 2007    Post subject: XHTML, CSS - How can I solve this problem? Reply with quote

Hi,
I'm working on setting up a travelblog on my site.
One of the features I'd like to have is a map system where I can show users exactly where I am at the present point by drawing a little dot on a map.

It'd work a bit like the way the location system works on BCF: I'd have a base image like this:

https://upload.wikimedia.org/wikipedia/commons/thumb/d/de/Uk_outline_map.png/450px-Uk_outline_map.png

And I'd be able to basically put a dot on the image wherever I was.
I don't need the backend calculation crap, all I need to know is

The best way to actively superimpose one image onto another image (preferably linkable, so that I can link to the latest post).
Thoughts?
____________________
the warped one: This is a follow up from the thread 'my willy hurts'
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

bob-a-job
Scooby Slapper



Joined: 12 Apr 2006
Karma :

PostPosted: 02:49 - 07 May 2007    Post subject: Reply with quote

<div class="main">
<img class="map" src="Uk_outline_map.png" alt="This is the map">
<img class="dot" alt="This is the dot">
</div>

<style type="text/css">
.main
{
position: relative;
}
.dot
{
position: absolute;
top: 10px;
left: 22px;
}
</style>


Briefly tested on IE7 + FF, not got any other testbeds..


Not sure what you mean by linkable to the latest post...
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

bob-a-job
Scooby Slapper



Joined: 12 Apr 2006
Karma :

PostPosted: 02:57 - 07 May 2007    Post subject: Reply with quote

Two links added in to make the map and dot linkable (guessedthis is what you meant). NOTE that that class for the dot has moved from the image to the <a> ref...

<div class="main">
<a href="#Map_is_linked"><img class="map" src="Uk_outline_map.png" alt="This is the map"></a>
<a class="dot" href="#Dot_is_linked"><img alt="This is the dot"></a>
</div>

<style type="text/css">
.main
{
position: relative;
}
.dot
{
position: absolute;
/* Y co-ord */
top: 100px;
/* X co-ord */
left: 22px;
}
</style>
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

bob-a-job
Scooby Slapper



Joined: 12 Apr 2006
Karma :

PostPosted: 13:35 - 08 May 2007    Post subject: Reply with quote

Oh and tw, i think the image created by this board is done on the server using image processing, ie the dots are drawn on map image by the server...
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Dom
World Chat Champion



Joined: 06 Sep 2004
Karma :

PostPosted: 14:04 - 08 May 2007    Post subject: Reply with quote

bob-a-job wrote:
Oh and tw, i think the image created by this board is done on the server using image processing, ie the dots are drawn on map image by the server...


Nope, it uses CSS like yours:
https://www.bikechatforums.com/profilemap.php?x=473250&y=173750&x2=468750&y2=113250&tag=bob-a-job
____________________
Photos and that
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts

bob-a-job
Scooby Slapper



Joined: 12 Apr 2006
Karma :

PostPosted: 14:14 - 08 May 2007    Post subject: Reply with quote

You are correct... well done have a karma cookie

should really check these sort of things before I say stuff... Rolling Eyes
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

pwntifex
World Chat Champion



Joined: 23 Aug 2006
Karma :

PostPosted: 20:15 - 08 May 2007    Post subject: Reply with quote

Wish I could create a script that placed the dot based on postcode...Thinking
Thanks for the code bob!
____________________
the warped one: This is a follow up from the thread 'my willy hurts'
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

sagalout
Nearly there...



Joined: 09 Jun 2006
Karma :

PostPosted: 20:36 - 08 May 2007    Post subject: Reply with quote

Postcodes in the UK are a nightmare because the Post Office own the rights to them. I've done a fair bit of geomapping for a few sites using googlemaps. Technically google wont goecode a UK postcode using its API because of the above reason, but theres a way around it. I can dig out the links if you want.
 Back to top
View user's profile Send private message Visit poster's website You must be logged in to rate posts

bob-a-job
Scooby Slapper



Joined: 12 Apr 2006
Karma :

PostPosted: 22:33 - 08 May 2007    Post subject: Reply with quote

Well here is a excel file holding loads of postcode (2821 i think) with their X, Y, long and lat values..

You will need to export data into a lookup table you have coded (i woiudl suggest server sided) and from the values gain it should plot the point for you...

Bob Thumbs Up
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

pwntifex
World Chat Champion



Joined: 23 Aug 2006
Karma :

PostPosted: 21:03 - 09 May 2007    Post subject: Reply with quote

bob-a-job wrote:
Well here is a excel file holding loads of postcode (2821 i think) with their X, Y, long and lat values..

You will need to export data into a lookup table you have coded (i woiudl suggest server sided) and from the values gain it should plot the point for you...

Bob Thumbs Up

That is a great resource! Have a cookie.
But behold as I ask yet another question which may be an incredibly stupid one: how do I convert the real x/y values into x/y values that correspond to the map?

Obviously 442900px x 419100px is not going to show up in de rite place...
____________________
the warped one: This is a follow up from the thread 'my willy hurts'
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

bob-a-job
Scooby Slapper



Joined: 12 Apr 2006
Karma :

PostPosted: 23:14 - 09 May 2007    Post subject: Reply with quote

You will need to find the X, Y values of a specific point. So on you map find out what x,y values is Where you think London and work it out from there..

For example:

Lets say London on you map is
x = 350
y = 500.

Find a london value in the spreadsheet lets say
x = 442900
y = 419100

then get the difference:
x = 442900 - 350 = 442550
y = 419100 - 500 = 418600

From these value you can now work out the new vaslues fopr any postcode:

Pretend edinburgh is
x = 442900
y = 419100

~Then values for map will be:
x = 442650 - 442550 = 100
y = 418900 - 418600 = 300


I think thats right... Wink


BTW i would do this for a few values and work out the average, will produce a more accurate result...


Thumbs Up
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Dom
World Chat Champion



Joined: 06 Sep 2004
Karma :

PostPosted: 09:37 - 10 May 2007    Post subject: Reply with quote

bob-a-job wrote:
Well here is a excel file holding loads of postcode (2821 i think) with their X, Y, long and lat values..

You will need to export data into a lookup table you have coded (i woiudl suggest server sided) and from the values gain it should plot the point for you...

Bob Thumbs Up


Cheers for uploading that Bob. It looks as though it could be very useful. Thumbs Up
____________________
Photos and that
 Back to top
View user's profile Send private message Send e-mail Visit poster's website You must be logged in to rate posts
Old Thread Alert!

The last post was made 19 years, 125 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.11 Sec - Server Load: 0.87 - MySQL Queries: 15 - Page Size: 76.56 Kb