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
|
|
|
|
|
|
|
|
|
|
|


A company must earn and keep trust or sales don't... Read More
A website is lifeline of internet home business. In order... Read More
"'Page Not Found' on this Server. Check the URL and... Read More
It never ceases to amaze me how many people set-up... Read More
There are millions and millions of websites on the Internet.... Read More
When people think about the Internet, they think about technology.... Read More
When you take a look at the most visited sites... Read More
The first step in setting up an online business...Starting an... Read More
So you've decided to start an online work at home... Read More
If you have some experience in web site design and... Read More
Installment 1Developing State-enabled Applications With PHPWhen a user is browsing... Read More
It amazes me how many people try to build serious... Read More
Designing an E-commerce Web site is not as simple as... Read More
Q. Hey, Cathy: I'm just setting up a website. What... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
The Internet has opened a whole New World of opportunity... Read More
Losing website sales and traffic is sometimes simply a case... Read More
An interesting eCommerce success factor that isn't precisely overlooked, but... Read More
Selecting the Perfect Domain NameThe first issue I have with... Read More
"What's in it for me?" you ask. "Why should I... Read More
Optimize your time. How much time each day must you... Read More
Web templates by nature are created to aid and ease... Read More
Most web sites are more like stage sets than real... Read More
1. Many people are not getting good or complete advice.... Read More
Running an effective website is a continuous process. I have... Read More
How can we add Word Rich Content to our Websites... Read More
Psychology is a long word which everyone thinks, "no, that's... Read More
What is the point of having a website, you may... Read More
Getting a Targeted Visitor to a website is a waste... Read More
Succeeding with an eCommerce website is a dream for many... Read More
Rosalind wants to share her inspirational poetry with a wider... Read More
1. Address your targeted audience on your business site. Example:... Read More
2 Golden Rules for an Engaging Website35% of visitors fail... Read More


Web sites are an Ongoing Part of Business.All too many... Read More
There is an ongoing debate about web copy. Some say... Read More
A company must earn and keep trust or sales don't... Read More
This is a growing concern amongst many business owners. Does... Read More
If your company own one or more stores, you might... Read More
First, using a lot of web graphics, flash, banners and... Read More
Every small business owner knows that they need a website,... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
It's now easier than ever to take payments on the... Read More
"What's in it for me?" you ask. "Why should I... Read More
Developing a website with content that entices visitors to return... Read More
Everyday thousands of new businesses make the leap and take... Read More
More and more businesses are recognizing the importance of content... Read More
Most interactive websites nowadays require data to be presented dynamically... Read More
Building a website and getting it online is easy. Driving... Read More
You've decided to create a website to market your products... Read More
So you have decided that you want to do freelance... Read More
Does My Web Site Require A Web Database?If your web... Read More
Many websites I come across don't have a single link... Read More
Most web sites are more like stage sets than real... Read More
The evolution of web development parallels the model of technology... Read More
After deciding what kind of internet business you want to... Read More
If you don't have a web site yet, are thinking... Read More
So you want to take a look at a real... Read More
August 8 2005, Macromedia announced a release of Studio 8.... Read More
1. SiteSpinner V2 - On Sale www.deprice.com/sitespinner.htmSiteSpinner is a user-friendly... Read More
There are many different traffic analysis tools, ranging from simple... Read More
Profiles are one of the best kept secrets around regarding... Read More
Think up a name and check if yourname.com is available.... Read More
There's been widespread speculation about the new legislation being introduced... Read More
Your business website is a critical aspect of being able... Read More
It never ceases to amaze me how many people set-up... Read More
Web Development |