Webmaster Tutorials - Web Development
Webmaster Resource Directory | Contact Us | Submit Your Site

LEARN

BUILD

PROMOTE

SELL

MANAGE

GET LISTED



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


More Web Development Articles

How To Evaluate Your Web Sites Performance
Setting up a website is the very first step of an Internet marketing campaign, and the success or failure of your site depends greatly on how specifically you have defined your web site goals.If you don't know what you want your site to accomplish, it will most likely fail to accomplish anything.

UK Online Shopping with an Edge, for Buyers and Sellers Alike
Any new website competing on the internet, needs to take its business seriously, as there is so much competition around. So, there needs to be an edge on quality, content, and general user appeal.

Web Site Development Process - The Life-cycle Steps
A system development process can follow a number of standard or company specific frameworks, methodologies, modeling tools and languages. Software development life cycle normally comes with some standards which can fulfill the needs of any development team.

Database Driven Web Site - Do You Need It?
Many of site owners still don't realize all advantages of database driven web sites and don't use all abilities they give. So when do you need a database driven web site and how it will make your web-life better?What is a database driven web site? Database driven web site is one that uses database for collecting and storing information.

You May Be Losing Valuable Traffic - And Not Even Know It!
Here's something you may never have thought of before:If I were to type your domain name?http://www.yourdomain.

How to Maximize the Value of Every Visitor to Your Website
While most marketers are beginning to understand the critical importance of maximizing conversion rates, few are tracking or working to maximize another critical measurement of website effectiveness.Visitor value?Visitor value is simply a representation of how much money you make per visitor to your website.

10 Simple Steps: Its Magic If You can E-Mail You can Update Your Web Page Dynamically
Dynamically Update Your Web Pages Via E-MailIf you can Send an E-Mail you can Dynamically update Your Web Pages. Following a few simple Steps and the Power of Blogs you can Mail in your Web Page Updates anytime you want too.

Earn On Offshore Web Design and Development
If you have some experience in web site design and want to make good money you can try acting as IT-outsourcing partner. Learn more what you should know and how to start.

Successful Commercial Sites
Do you make your website just to entertain yourself or do you want it to be a great web store? The fact is more than 80% of websites are trying to sell you something. There is nothing wrong if you want to get some money from the website you made, but remember to put some REALLY interesting information on your pages.

Make Your Own Brand!
There are millions and millions of websites on the Internet. You NEED to be different in some way from all of them! If you could get a visitor to your website, that means nothing.




Helpful Tools

NetDownload
freeware and software downloads

Findahost
web hosting directory

FindaTechJob
new computer jobs daily

ManagedHostingPro
Managed Hosting and Colocation



© 2007 webmasteredge.com