473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

geographical coordinates

Hello,

I've some geographical coordinates and I'd like to put them on a map.

Example: I've the map of the USA. Once I've selected Chicago, I'd like a
point-cross or what ever, on the Chicago point over the map.

How can this be done in PHP ?

I know you can do everything in GD, but does something similar already exist
?

Bob

Jun 30 '06 #1
8 2332
Message-ID: <44***********************@news.sunrise.ch> from Bob Bedford
contained the following:
Example: I've the map of the USA. Once I've selected Chicago, I'd like a
point-cross or what ever, on the Chicago point over the map.

How can this be done in PHP ?

In image , as an input type will return the coordinates of the point
clicked. I think the simplest way would be with an absolutely positioned
transparent .gif, positioned according to the co-ordinates returned.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jun 30 '06 #2
The way that I suppose is to use on of the form elements which is
called (input, type=image)
this element is considered as an image button, it allows you to click
on it (on the image) and then with submitting the form it submits the
coordinates of the image you are using

you can use it this way:
<form name="form1" method="get" action= "cityInfo.php" >
<input name="img" type="image" src="yourMap.jpg" >
</form>

On cityInfo.php page write the following:
$x = $_GET[img_x];
$y = $_GET[img_y];

By this way $x and $y will contain the coordinates of the exact point
that the user had clicked on it (in pixels of course)

I hope this will be what you needed

Jul 1 '06 #3
Tom
Have you looked into the Google Maps API?

http://www.google.com/apis/maps/

Tom
Bob Bedford wrote:
Hello,

I've some geographical coordinates and I'd like to put them on a map.

Example: I've the map of the USA. Once I've selected Chicago, I'd like a
point-cross or what ever, on the Chicago point over the map.

How can this be done in PHP ?

I know you can do everything in GD, but does something similar already exist
?

Bob


Jul 1 '06 #4

"Tom" <kl******@gmail.coma écrit dans le message de news:
11**********************@d56g2000cwd.googlegroups. com...
Have you looked into the Google Maps API?

http://www.google.com/apis/maps/
Thanks for the info. Unfortunately, we think that google map will be a
paying service soon, so we don't want to create such service then have to
stop it because GoogleMap becomes paying.

Also What we need is exactly show a point on a map, not detect where the
user clicked.

Thanks for your message.

Jul 2 '06 #5
Message-ID: <44***********************@news.sunrise.chfrom Bob Bedford
contained the following:
>Also What we need is exactly show a point on a map, not detect where the
user clicked.
Umm...why are they not the same?

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 2 '06 #6
Umm...why are they not the same?
>
Cos he's got the latitude and longlitude and wants to convert that to
xy coords.
I am assuming that the lat/long is derived from a data source.

You need to convert that into xy coords for your map.

I would do this:-

Determine the lat/long of top-left and bottom-right of the map
Determine the width and height of the map in pixels

work out the xy coords by calculating degrees east and south of the
top-left corner. If you need minutes and seconds, remember you are
working in base 60!!!

display the main map in a <DIV>

Display the coordinate marker in another <DIVand position it relative
to the map DIV using and in-line style sheet; setting up the horizontal
and vertical offsets using PHP. If you are putting up more than one
marker you may need to manage the layer order of the DIVs as well.

This should display the map reference in the right place but you would
not be able to right click and save image as, because it is actually
two images..

frothpoker

Jul 4 '06 #7
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bob Bedford wrote:
Example: I've the map of the USA. Once I've selected Chicago, I'd like a
point-cross or what ever, on the Chicago point over the map.

How can this be done in PHP ?
With a clever mix of CSS and absolute positioning.

Let's suppose you have a HTML element (e.g. an <divtag with the map
inside) with known widht and height, and it is positioned relatively to the
document flow.

Then, a small <imgcontaining a crosshair or whatever. You only have to
position it absolutely (where "absolute" means "relative to the top-left
corner of the first parent having absolute or relative positioning"), and
specify top anf left offset.

Try something like this:

<div class='container' style='position:relative; width:500px;
height:300px;'>
<img src='map.png' style='width:500px; height:300px;'/>
<img src='crosshair.png' style='position:absolute; left:129px; top:72px;'/>
</div>

After you have tested t works in the major browsers, then replace the offset
with the required values to put the crosshair in the desired place. I
suppose you know how to do that with PHP.

- --
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

http://acm.asoc.fi.upm.es/~mr/ ; http://acm.asoc.fi.upm.es/~ivan/
MSN:i_*************************@hotmail.com
Jabber:iv*********@jabber.org ; iv*********@kdetalk.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEqlkm3jcQ2mg3Pc8RAu+3AJsFaRq7GXa95in0V2WLHF Jwtsq8UACfaM4t
QsAQh1B1og+MFukq5ZDdqkQ=
=kSY0
-----END PGP SIGNATURE-----
Jul 4 '06 #8
Hello,

on 07/02/2006 06:23 AM Bob Bedford said the following:
"Tom" <kl******@gmail.coma écrit dans le message de news:
11**********************@d56g2000cwd.googlegroups. com...
>Have you looked into the Google Maps API?

http://www.google.com/apis/maps/
Thanks for the info. Unfortunately, we think that google map will be a
paying service soon, so we don't want to create such service then have to
stop it because GoogleMap becomes paying.
No, the Google Maps API is free for sites freely accessible to their users.

For premium (paying) sites or enterprise sites (sites only available in
a intranet) there is the Enterprise Google Maps.

http://maps.google.com/support/bin/a...y?answer=26392

Also What we need is exactly show a point on a map, not detect where the
user clicked.
If you think you can use Google Maps API, you may want to try this forms
generation class that comes with plug-in for showing Google Maps in your
site.

http://www.phpclasses.org/formsgeneration

Even if you just want to show a read only map, it simplifies the
generation of the all the map HTML and Javascript to point any locations
you want and for instance make them show an information window like for
instance in this example of the map of the PHP user groups in the United
States.

http://www.phpclasses.org/browse/gro...ry/country/us/

--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jul 8 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: fausty | last post by:
Hi, I have a question. I hope someone can help me. :-) I'm writing an internet marketing application in php and I need to import inside a mysql db all data about countries, district or...
3
by: A.M | last post by:
Hi, We have special kind of service that covers just north on America (US and Canada), so we want to redirect users comming from another country to another page. I am looking for a web...
4
by: Nick | last post by:
hi, guys I don't know where should I put this post, because this is a general question, not really a c# question. The question is how to caculate the real distance between two geographical...
4
by: torrance_bloke | last post by:
Hi, Does anyone know if DB2 has the capability to cluster in an active/active mode over geographical distances. I am aware of the replication tools and HADR capabilities but this is more...
3
by: steve | last post by:
Hi All I have textboxes within a TableLayoutpanel and I want to be able to position an independant control adjacent to a selected textbox This independent control allows selection of text to...
3
by: Elvey | last post by:
Is there a URI scheme for (geographical) map or address location? e.g. something like postal-geographical:postal:123_Main_St,Anywhere_AW,USA...
1
by: Cainnech | last post by:
Hi all, I've got a bit of a challenge. I've got a script which displays the mouse coodinates if you click on an image. Now I would like to convert these coordinates to pixelnumber. Let me see if I...
3
by: rpupkin77 | last post by:
Hey, How does one going about their user's geographical location? Is that even a PHP question. For example, a site may say "Find others near Boston", but if you were in New York, it would say...
0
by: raylopez99 | last post by:
keywords: logical coordinates, page coordinates, world coordinates, device coordinates, physical coordinates, screen coordinates, client coordinates. offset rectangle. WYSIWYG rubber rectangle...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.