In this example I have used the map of the Itasca demo of the Mapserver. I have done only small changes to the map file. The Itasca demo has (into the html file) the parameters of the path where to store the images:
IMAGEPATH "set in index.html" IMAGEURL "set in index.html"
I have changed them as fixed path
IMAGEPATH "/tmp/ms_tmp/" IMAGEURL "/ms_tmp/"
Than I have set as STATUS ON several layers for a better map.
The Database
The positions and the images paths that have to be shown on the map are stored into a table of a database in MySql. I have created a new database named "mapexample" and a new table "weather":
CREATE TABLE weather (
id bigint(20) NOT NULL auto_increment,
imagepath varchar(255) default NULL,
x double(16,4) default NULL,
y double(16,4) default NULL,
PRIMARY KEY (id)
)
and than I have inserted into the table the positions of the weather images and the path of every icon:
INSERT INTO `weather` VALUES (1, '/data/weather/icons/sunny.gif', 478107.0000, 5250301.0000); INSERT INTO `weather` VALUES (2, ''/data/weather/icons/cloudy.gif', 408107.0000, 5220301.0000); INSERT INTO `weather` VALUES (3, ''/data/weather/icons/storm.gif', 468107.0000, 5270301.0000); INSERT INTO `weather` VALUES (4, ''/data/weather/icons/variable.gif', 408107.0000, 5310301.0000);
It is not necessary for the images to be stored into a directory visible from the web, because are taken directly by the script and then merged with the map.
The PHPMapscript code Here is the code I have used for generating the map: ">
More info: http://www.parsec.it/tutorials/
Roberto Colonello owns and operates http://www.parsec.it/tutorials/ and http://www.parsec.it/tutorials/
efficient cleaning crew Northbrook ..Writing for the web is totally different to writing for... Read More
Web sites are not just places to sell things; they... Read More
The "robots" meta tag, when used properly, will tell the... Read More
In 1995 a new era of accessibility for disabled people... Read More
After years of working with entrepreneurs who developed their first... Read More
If you are like me you have wanted to build... Read More
Server Side Includes (SSI) with ASP People often... Read More
What do you mean, you don't have a website for... Read More
It may come as some surprise to a traditionally off-line... Read More
In this day and age most businesses consider having their... Read More
"If you build it, they will come"; is an age... Read More
Right after the thought, "I need a website," people usually... Read More
Better Web Site ROIHow to increase your business profitability by... Read More
Do you make your website just to entertain yourself or... Read More
So you want to have a website. You have gone... Read More
Understanding and using web analytics.In recent years, website marketers were... Read More
"Don't Sell the Steak, Sell the Sizzle."Have you heard of... Read More
One of the things that many people overlook when building... Read More
What is web accessibility & why is it important?Web accessibility... Read More
Selecting the Perfect Domain NameThe first issue I have with... Read More
As a business you can't afford to ignore the Internet... Read More
A professional online reputation is essential to the flourishing of... Read More
Just like all things in life, the ways to run... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
Did you know that hosting companies overcrowd their servers despite... Read More
cleaning lady near Wilmette ..For years now I've been looking to start my own... Read More
SummaryHere's the scoop on what you must know when designing... Read More
Q1.Why would I need a web site? A1.- Improve my... Read More
I had a client say something to me the other... Read More
After years of working with entrepreneurs who developed their first... Read More
The first thing my business consultant (read brother-in-law) asked me,... Read More
Keywords in Search Engine Optimizing and Search Engine Marketing are... Read More
See how you can create graphic effects on text with... Read More
This is a growing concern amongst many business owners. Does... Read More
An Introduction to Server Side IncludesBeginner? That's OK!While much has... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
The first step in setting up an online business...Starting an... Read More
First, using a lot of web graphics, flash, banners and... Read More
You have seen those web pages where they have the... Read More
People like to get immediate responses to requests. Autoresponders are... Read More
Many executives and investors are skeptical that software products can... Read More
"How do I improve web site sales figures?" The CEO... Read More
With search engines putting a damper on direct reciprocal links,... Read More
As increasing numbers of people search for information on the... Read More
So what do you do if need to get a... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
We are clearly well past the innocent "golden age" of... Read More
Project Safekids provides webmasters a valuable tool which could save... Read More
If you don't have a web site yet, are thinking... Read More
Does your website have a links/resources page?Do you exchange reciprocal... Read More
Web Development |