How to Draw Icons or Images on a Mapserver Generated Map

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

In The News:


pen paper and inkwell


cat break through


3 Rules of Website Designing and Layout

Now that you have got your domain name registered, your... Read More

Achieving Differentiation With Your Website

Internet Marketing is not a miracle marketing strategy ? competition... Read More

2 Key Ways to Make Your Site a Success

If one more business owner tells me their website sucks... Read More

5 Ways to Build a Website

If you are like me you have wanted to build... Read More

Make Your Artist Website Sell!

SummaryHere's the scoop on what you must know when designing... Read More

3 Ways To Increase Your Websites Conversion rate

Everywhere you look these days, people are telling you that... Read More

The Number 1 Reason Most Websites Fail

Failure, just like success, is measured differently by each and... Read More

How to Make Your Own Website For Free

If you like the Internet and surfing through the billions... Read More

Frequent Business Question: How Do You Start a Web Business?

Today it seems everyone is jumping on the entrepreneur bandwagon,... Read More

Web Site Promotion: How To Advertise Your Website For Profits

Making money with your web site is the dream and... Read More

A Web Site for Your Small Business: How to Set Up a Website

Your web site will be your window to the world.... Read More

Does Your Business Really Need A Website?

Website, website, website, everyone says you need one. But do... Read More

The Top Ten Benefits of Having a Web Site

Do you need a web site? Are you considering getting... Read More

How to Build a Database Driven Web Site

If you ever want to create a state directory, article... Read More

What Does An Ex-Basketball Coach Know About Pulling Web Metrics?

In my previous life.....Actually, my previous JOB life, I was... Read More

5 Tips For A Better Website

Having an eye catching website is great, but are you... Read More

Building eCommerce Websites that Work - Part 3

An interesting eCommerce success factor that isn't precisely overlooked, but... Read More

User Interface Design: Key to Achieve Best Web Development

From early days of www, the Internet sites that are... Read More

Eight Deadly Web Site Mistakes and How to Avoid Them

Creating and maintaining an effective presence on the Web has... Read More

Improve Conversion Rates ? Effective Content

Your site is fast and getting traffic, but conversion rates... Read More

Website Development: Become Your Own Expert

Starting and maintaining a business is challenging enough without the... Read More

Web Sites ? Should I Learn or not?

A common dilemma most small and medium businesses face when... Read More

The Problem with Paypal On Your Web Page

When I set up my website I felt paypal was... Read More

WYSIWYG Versus Coding: HTML With A Purpose

After years of working with entrepreneurs who developed their first... Read More

If Its Done Its Done for: Make Your Website Part of Your Business before You Build

Web sites are an Ongoing Part of Business.All too many... Read More

Creating Compelling Content , Write It and They Will Come

In a previous ezinearticles.com article,"I Need real visitors, Not Search... Read More

Duplication vs. Individualism

How can we add Word Rich Content to our Websites... Read More

Maximizing ROI via Web Site Traffic Analysis

We are clearly well past the innocent "golden age" of... Read More

4 Steps to Selling More With Your Web Site

Most web sites are more like stage sets than real... Read More

Five Essential Questions to Answer Before Creating Your First (or second...or third) Website

Right after the thought, "I need a website," people usually... Read More

How Did You Get Here?

When marketing your website, it's important to know which of... Read More

Dreamweaver 8 Preview

August 8 2005, Macromedia announced a release of Studio 8.... Read More

9 Simple Steps to Create a Background Tiled Image Branded with Your Name

You have seen those web pages where they have the... Read More