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 a waste
(Re: City pays $128,000 for new website design) Wow -- $128,000 for this amateur website? Another colossal waste of my property tax dollar. Ranks right up there with the addition to the arena that I'll never use and the new bridge built so Bulls fans can get to Wendy's quicker after the game.[...]
Design Build Construction Company The Korte Co. Architects New Website and On...
ST. LOUIS, MO--(Marketwire - 09/02/10) - The Korte Co. has launched its Drupal-based website at http://www.korteco.com . The updates to the site reflect the "build smart" mantra of the St. Louis based, Design-Build Construction Company. By enhancing the design and usability, The Korte Co. deliver a rich portfolio of design build projects in a multitude of industries ...
Website Testing Manager, Website Conversion Manager - A/B Testing- IT
Website Testing Manager, Website Conversion Manager - A/B Testing - Notting Hill, London Website Testing Manager, Website Conversion Manager - A/B & Multivariate Notting Hill, London Up to £40,000 + Bonus + Equity Founded by a team of 4 ex Googlers, we are a London based technology solutions and advisory company that improves the efficiency of online businesses and web-based properties.
BELLEVILLE: New district website could be ready for start of school
On Aug. 23, Van Buren Schools' technology director Harvey Chesney presented an update on the new district website platform set to be launched - hopefully - for the start of school on Sept. 7.
On Tuesday, improved website goes live
The North Platte Telegraph A new and improved North Platte Telegraph website will launch at www.nptelegraph.com on Tuesday, Aug. 17.

 

 

PeoplesChoice | Workstation | PhotoLog | Web Design | Photo Blog | Web Development | Articles Searches | Daily Blog

Copyright ゥ 2008 All Rights Reserved Web Designers