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

Website sells Shariah-approved sex aids to Muslims
The El Asira home page is a discreet design with two simple links for men and women. The only clue to its content are the small blue and pink hearts at the top of the page.
New Web Design For Miller's Buggy Line Tours
Digital Hill announces the launch of a new web design for Miller's Buggy Line Tours of Shipshewana, Indiana. This new website for the Shipshewana area business includes a photo gallery, and a CMS editor allowing for easy content editing and creation of both main and sub categories. The new web design gives Miller's Buggy Line Tours the website control they need to easily manage their website and ...
Website Provides New Access to Denville?s North Jersey Design Center for Impl...
Cosmetic Dentists Daniel Orellana, DDS and William Johnson, DDS have provided North Jersey residents new access to their state of the art offices with the launch of their new website designed by Roadside Multimedia.
Avery Graphics Design 66 Challenge Contest Winners Announced
Painesville, OH Three designs have crossed the finish line and are in the winners circle of the Avery Graphics Design 66 Challenge. Salute the Soldiers by Daniel Wayne Logue was selected as the winning design, chosen by NASCAR Nationwide Series driver Steve Wallace, the Rusty Wallace Racing team and sponsor 5-Hour Energy. More than 120 entries from across the United States and Canada were ...
Tampa Web Development Firm Bayshore Solutions Launches the Flatwoods Consulti...
Bayshore Solutions is proud to announce the launch of the Flatwoods Consulting Group Inc. (Flatwoods) website. The Tampa Web design for the ecology and environmental consulting firm website is based on natural photo images and colors portraying a modern look and consistent branding message.

 

 

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

Copyright © 2008 All Rights Reserved TheWebStylist.com