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/tutorials/ and http://www.parsec.it/tutorials/

apartment cleaning near Highland Park ..
In The News:

Holiday scams spike during Black Friday and Cyber Monday as criminals exploit your leaked personal data. Learn how to protect yourself from fake stores and phishing.
Commerce Department proposes TP-Link router ban over Chinese security risks. Learn how this potential prohibition could affect your home network and devices.
Hyundai AutoEver America suffered a data breach affecting 2,000 current and former employees, exposing names, Social Security numbers and driver's license information.
Washington court rules automated license plate reader images are public records, even when stored by vendors like Flock Safety, setting precedent for transparency.
Fake airline texts claiming flight cancellations are targeting travelers with convincing scams. Learn how cybercriminals steal personal data and credit card info.
Discover how iOS 26's new Adaptive Power feature automatically extends iPhone battery life by learning your usage patterns and adjusting performance intelligently.
New TikTok malware campaign tricks users into running PowerShell commands that download Aura Stealer, which steals credentials and authentication tokens.
Gaia Family offers fixed upfront pricing for IVF cycles with unlimited embryo transfers and financial protection, partnering with over 100 U.S. fertility clinics.
The Jetsons Act aims to position Pennsylvania as a leader in advanced air mobility by establishing regulations for hybrid ground-air vehicles.
Fake Geek Squad invoice emails are targeting users with convincing charges and urgent phone numbers to steal personal information and money.
Fox News Digital's artificial intelligence newsletter digs into a robot in Russia that faceplanted, George Clooney's alarm and OpenAI's rivalry with the New York Times.
Major data breach at Conduent exposes personal information of 10+ million people. Government contractor hit by cyberattack affecting Medicaid, child support systems.
Texas startup Janta Power raises $5.5M for innovative vertical solar towers that generate 50% more energy than traditional panels while using just one-third the land.
NASA's twin ESCAPADE spacecraft launched aboard Blue Origin's New Glenn rocket Thursday afternoon from Cape Canaveral, beginning their journey to Mars with arrival expected in 2027.
Learn how to set email reminders on iPhone and Android so you never forget to reply again. Simple built-in features help you stay organized and on top of messages.
Discover how Apple's passkeys revolutionize Mac security by replacing vulnerable passwords with biometric authentication and encryption for ultimate protection.
New survey reveals 78% of parents fear AI scams targeting their kids, yet nearly half haven't discussed these threats. Learn why this dangerous gap exists.
Chrome now autofills passport and driver's license info automatically. Google's latest browser update adds official document support with encryption and user control.
Scammers impersonate Department of Veterans Affairs employees claiming veterans owe money, but real VA communications only direct to VA.gov or official channels.
The AltoVolo Sigma hybrid-electric aircraft flies 500 miles at 220 mph while operating 80% quieter than helicopters, featuring safety systems and compact design.
Google search scam alert: fake customer service numbers can give scammers remote control of your phone. Learn how to spot these traps and protect yourself.
Electric vehicles overtake gas cars in total CO2 savings after just two years of driving, with emissions benefits growing over time as power grids get cleaner.
Louvre Museum reportedly used "Louvre" as password for surveillance system during $100M jewel heist. Learn how weak passwords put even famous institutions at risk.
Bipartisan AI jobs bill from Sens. Hawley and Warner would require companies to report AI-related layoffs and hiring to Department of Labor quarterly.
Joe A. from Shelton, Connecticut, lost $228,000 to a ZAP Solutions cryptocurrency investment scam after his divorce, highlighting rising online fraud.

Let Your Customers Redesign Your Website!

When you purchase a new item from a Yahoo! Store,... Read More

Selling Your Site: Outsource or Homemade?

To the starting internet entrepreneur, there is nothing more discouraging... Read More

How to Maximize the Value of Every Visitor to Your Website

While most marketers are beginning to understand the critical importance... Read More

Disability Discrimination Act (DDA) & Web Accessibility

There's been widespread speculation about the new legislation being introduced... Read More

Beyond Web Usability: Web Credibility

If you've been developing websites on Mars for the past... Read More

PHP Redirect

A PHP Redirect automatically transfers a web user from one... Read More

Are You Losing Sales Because of These 4 Simple Website Mistakes?

Losing website sales and traffic is sometimes simply a case... Read More

Five Question-Five Minute Web Makeover Quiz

If you haven't made the sales and built your clients... Read More

Up The Sandbox!

Go to any internet marketing forum you want these days... Read More

How Your Own Website Helps Your Small Business Grow

What do you mean, you don't have a website for... Read More

Five Steps to Create Your Software Product with Outsourcing

Many executives and investors are skeptical that software products can... Read More

How to Get a Better Web Site ROI

Better Web Site ROIHow to increase your business profitability by... Read More

WYSIWYG Versus Coding: HTML With A Purpose

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

The 2 Most Common Web Site Mistakes

When we review the sites of potential clients, there are... Read More

Three Things Every Website Should Do

When I started my company in 2002, I knew I... Read More

Benefits Of An Accessible Website: Part 1 - Increase In Reach

The DDA (Disability Discrimination Act) states that service providers must... Read More

Web Site Optimization: How To Speed Up Your Web Site By Minimizing Your GIF and PNG Image Bit-Depth

Are bloated images slowing down your web site and causing... Read More

How to Build a Database Driven Web Site

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

Why Every Small Business Owner Needs Two Websites

Every small business owner knows that they need a website,... Read More

Achieving Differentiation With Your Website

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

Creating a Sticky Web Site

When used to describe a web site, the term "sticky"... Read More

Where on Earth is Your Websitee?

You've just finished congratulating your marketing team. After six months... Read More

Web Coach Tip: What You Should Know About DIY Web Sites

Recently, a friend asked "What's the deal with those DIY... 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

Newsletter Management Using PHP w/o mySQL for Beginners

Let's begin by setting some limits. If you're like me,... Read More

cleaning lady near Arlington Heights ..