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 and http://www.gmdir.com
|
|
|
|
|
|
|
|
|
|
|


Customer service questionnaires can help your clients better understand their... Read More
While it may seem like a "quick and easy" task,... Read More
Many of site owners still don't realize all advantages of... Read More
1. Address your targeted audience on your business site. Example:... Read More
Most web sites are more like stage sets than real... Read More
In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More
When you started reading this sentence you assumed lo acabarķa... Read More
See how you can create graphic effects on text with... Read More
For years now I've been looking to start my own... Read More
--------------------------------Why Should You Create a website?--------------------------------A. What do you want... Read More
In my previous life.....Actually, my previous JOB life, I was... Read More
When you consider the billions of individuals and companies on... Read More
1. Upload robots.txt file in to your root directory and... Read More
If you've been developing websites on Mars for the past... Read More
Optimize your time. How much time each day must you... Read More
A website lets you put your products in front of... Read More
There is an ongoing debate about web copy. Some say... Read More
The popular search engine Google indexes over 8 billion websites.... Read More
Affiliate programs are a great way to earn an income... Read More
Spend time planning your Web site. Before you design a... Read More
Installment 1Developing State-enabled Applications With PHPWhen a user is browsing... Read More
You hear a great deal about the Internet these days... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
This simple question can take on several different forms, but... Read More
Dance is how you pamper your soul and satiate your... Read More
Is your website Really useful?I had a 'rep' in yesterday... Read More
I recently received an unsolicited e-mail from some company offering... Read More
Absolutely everything stems from the purpose of your website -... Read More
A professional online reputation is essential to the flourishing of... Read More
An automated accessibility tool is a piece of software which... Read More
Before you start building your site, ask yourself "WHY?". Why... Read More
"I am a writer, not a business-person. I don't want... Read More
Your business website is a critical aspect of being able... Read More


That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
More and more non-profit organizations are developing websites to help... Read More
Internet Marketing is not a miracle marketing strategy ? competition... Read More
One of the most important parts of establishing a new... Read More
Many of site owners still don't realize all advantages of... Read More
If you haven't made the sales and built your clients... Read More
Cost Effective Advertising. Online selling. Increased geopgraphic range. Wider... Read More
1. The first page appears quickly.It's a good way to... Read More
The internet is a sea of knowledge. Getting your information... Read More
A website is like an information flow, with you as... Read More
RIVERSIDE, CA August 4, 2004 ?- "Historically, small business owners... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
Creating and maintaining an effective presence on the Web has... Read More
If you were asked to put a value on your... Read More
Never has competition been so difficult in the Internet world.... Read More
No matter the size of your business, having a web... Read More
Selecting the Perfect Domain NameThe first issue I have with... Read More
Why do some sites succeed while the vast majority of... Read More
Profiles are one of the best kept secrets around regarding... Read More
So you have decided that you want to do freelance... Read More
Globalize Your WebsiteThe Internet has unlocked a wide array of... Read More
There's been widespread speculation about the new legislation being introduced... Read More
It never ceases to amaze me how many people set-up... Read More
We've all seen those messages on some websites warning not... Read More
Think up a name and check if yourname.com is available.... Read More
Webmaster tools are vital to becoming both efficient and effective... Read More
You want to give your site's visitors a way to... Read More
Have you ever thought the secret behind the success of... Read More
Just starting out, you can start with a simple informational... Read More
Yahoo has long offered email, an online calendar, notes, bookmarks,... Read More
Starting an internet business can be confusing to non-veterans. The... Read More
1) Data CaptureOne easy way to collect e-mail addresses and... Read More
Designing an E-commerce Web site is not as simple as... Read More
Web Development |