Market Data Analyst (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume

Interactive Maps with PHP
I'm working to develope a web-based Geographical Information System (GIS) and one of the big problems I had was to write an easy algorithm to zoom a portion of a map.
First of all I tried to use Server Side Maps, but I found that they need a Perl script with too many lines of code. So I came to phpbuilder and found an article from Rasmus Lerdorf : Creating Dynamic Images with PHP that shows how useful PHP and the GD library could be for that purpose. Thanx Rasmus!
I'll explain a method to zoom a portion of an image by using PHP and gif files.
The first step is to generate a map in its big size (in my example a 747x360 pixels gif called caligran.gif), then I resize the map to its small size (200x96 gif called cali.gif). It's very important to work with gif files because GD library can manipulate only those image types.
We need three files to work besides the gif images. The first file called map.html has the small map and its code is:

<HTML>
<HEAD></HEAD>
<BODY bgcolor="#CCCCCC#">
<FORM METHOD="POST" ACTION="ampliacion.php3">
<INPUT TYPE="IMAGE" SRC="cali.gif" NAME="mapa" BORDER="0">
</FORM>
</BODY>
</HTML>
The principal purpose of this file is to transmit the coordinates where the user clicks on the small map.
Here, the most important tag is <INPUT TYPE="IMAGE" .... > On a browser that supports this tag, the image is displayed. Clicking on any part of the image is equivalent to clicking on a Submit button. If NAME is mapa, the values mapa_x and mapa_y are transmitted to ampliacion.php3 through normal form and URL encoding. These two fields contain the coordinates where the user clicked.
[ Next Page ]


Comments:
RE: Performance with BIG images?Don Deskins07/11/07 13:27
how i use map in phpdinesh06/28/05 06:48
can't remove borderlakhbir06/20/05 07:59
No gif or jpg support?Stripe-man03/23/05 02:19
RE: Can't get this workingBen12/16/02 00:57
RE: Performance with BIG images?taeho10/20/02 07:54
RE: GIS systems - come see thisSinh Nguyen09/06/02 13:27
Can't get this workingJohn Guarino09/06/02 11:41
pixsel information azam09/02/02 11:07
magataperdrap06/21/02 21:59
Multiple selections?Joseph02/28/02 22:33
GIS systems - come see thisRagnvald Larsen01/30/02 17:43
RERE: Performance with BIG images? (to Steve)zulu11/21/01 10:22
RE: Drawing mapsGerardo Tasistro11/13/01 00:07
Drawing mapsDaniel11/11/01 06:22
RE: Performance with BIG images? (to Steve)Gerardo Tasistro11/05/01 21:10
Web PagesShankar10/24/01 06:26
images and htmljaydj09/14/01 00:07
RE: Performance with BIG images?James Smith06/12/01 02:26
successedy04/26/01 03:49
no image on 2nd pageedy04/19/01 01:08
Image zoomingR.Talis02/20/01 22:35
Image zoomingR.Talis02/20/01 22:32
RE: Performance with BIG images?Jose' L Landivar01/20/01 20:06
Performance with BIG images?Steve Beuret11/29/00 09:19
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.