Home | Site Map           
   
     

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

Yahoo! News Search Results for website design
Yahoo! News Search Results for website design

Concrete-Countertops.org: New Website Explores Concrete Countertop Design Opt...
New website, Concrete-Countertops.org offers consumers detailed information on choosing concrete countertops over other leading countertop materials. Built to guide consumers looking for alternative countertop materials, the site covers design ideas, how concrete countertops are made, how they perform and their eco benefits. (PRWeb Nov 21, 2008) Read the full story at ...
Concrete-Countertops.org: New Website Explores Concrete Countertop Design Opt...
New website, Concrete-Countertops.org offers consumers detailed information on choosing concrete countertops over other leading countertop materials. Built to guide consumers looking for alternative countertop materials, the site covers design ideas, how concrete countertops are made, how they perform and their eco benefits.
VKI Studios Takes First Prize in Google's Website Optimizer "Design a Feature...
In a contest sponsored and judged by Google, entrants were invited to design the best new feature for Google Website Optimizer?. On November 11, 2008, it was announced that VKI Studios had won first prize with its suggestion of an "Integrated Experiment Duration Calculator".
Eye-Catching Cash Loans - Cash Doctors Launch Fresh Website Design (PRWeb via...
Australia's leading online payday loan company, Cash Doctors, implement new and improved website design.
Pampered Passions Fine Lingerie Launches New Website Design & Additional Feat...
PamperedPassions.com, a leading retailer of women's lingerie and romantic gifts -- have announced the release of a new website design, more user-friendly features and free shipping on all USA orders.

 

 

Food     PeoplesChoice | Web Starter | PhotoLog | Workstations | Web Design | Photo Blog | Articles Searches | Daily Blog     MP3

Copyright © 2008 All Rights Reserved TheWebStylist.com