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/
Trevor chicago limos ..Are you, like many other website owners, frustrated at the... Read More
"How do I improve web site sales figures?" The CEO... Read More
A website lets you put your products in front of... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
Huge Mistake #1: Creating a Website with Flash -- Did... Read More
While creating a Web site may seem like... Read More
80% of your Web site is Maintenance!Once your Web site... Read More
How popular is online shopping? And is there room for... Read More
D.zigns dzignerwebs The Basics Before starting on... Read More
Failure, just like success, is measured differently by each and... Read More
Spend time planning your Web site. Before you design a... Read More
Every small business owner knows that they need a website,... Read More
When people think about the Internet, they think about technology.... Read More
After planning the design and content of your website, it's... Read More
A while ago one of my clients approached me and... Read More
Can you imagine the hypocrisy of spending thousands of dollars,... Read More
Wow, we`ve already taken a domain and chosen a web... Read More
To the starting internet entrepreneur, there is nothing more discouraging... Read More
Your web site will be your window to the world.... Read More
The Disability Discrimination Act states that service providers must not... Read More
There are millions and millions of websites on the Internet.... Read More
Analyzing traffic to a site is a key factor in... Read More
First, using a lot of web graphics, flash, banners and... Read More
A website is the most versatile and cost-effective marketing tool... Read More
An Introduction to Server Side IncludesBeginner? That's OK!While much has... Read More
Baylis taxi from Midway ..More and more businesses are recognizing the importance of content... Read More
There are lots of HTML editors on the market, however,... Read More
Dynamically Update Your Web Pages Via E-MailIf you can Send... Read More
Optimize your time. How much time each day must you... Read More
Does My Web Site Require A Web Database?If your web... Read More
From early days of www, the Internet sites that are... Read More
After years of working with entrepreneurs who developed their first... Read More
Directory Generator, a product from Armand Morin and Marc Quarles,... Read More
Mini Websites are the most powerful and cost effective solution... Read More
A while ago one of my clients approached me and... Read More
A PHP Redirect automatically transfers a web user from one... Read More
"How do I improve web site sales figures?" The CEO... Read More
1. Many people are not getting good or complete advice.... Read More
In this example I have used the map of the... Read More
There is an ongoing debate about web copy. Some say... Read More
That's right. According to a recent study by Nielsen/NetRatings, Amazon.com... Read More
Most interactive websites nowadays would require a user to log... Read More
We are clearly well past the innocent "golden age" of... Read More
In my previous life.....Actually, my previous JOB life, I was... Read More
One of the things that many people overlook when building... Read More
In this day and age most businesses consider having their... Read More
1. Choose a big enough font size. A size 12... Read More
What is SQL? SQL stands for Structured Query Language and... Read More
What is the most important part of your online business?Many... Read More
No matter the size of your business, having a web... Read More
Web Development |