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 codeHere 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
|
|
|
Created & Maintained by Empower! CMS Web Sites
Host2Sell Web Hosting | Emarketing Workshops | Site SEO Review | FREE NewsletterThree Things Every Website Should Do
When I started my company in 2002, I knew I needed to have a website. Why? To provide credibility! How can a company be "real" in this day and age if it doesn't have a website? So, like many companies, I published an informational website that explained "here's who we are, and here's what we do".I didn't spend a lot of time worrying about my website. I certainly didn't think of it as a strategic weapon in my company's marketing arsenal. That started to change in the spring of 2004 when a newsletter was forwarded to me by a ...(related: Web Development)
Making The Most Of Your Website: Start With The Basics
One of my most salient memories from when I sold real estate in Oregon for my Dad's company was listing a property where the owners had initially tried to sell it For-Sale-By-Owner with no success. After ...(related: Web Development)
What Business Owners Must Know Before They Commit To Having A Web Site
Q1.Why would I need a web site?A1.- Improve my service by providing the existing clients with useful resourcesThat will help me to build up the loyalty of the clientele and get returning clients.Examples: my contact details, this month special, technical info on the products.- Obtain new clients via InternetThat is how I am going to make new sales.Example: local resident searching for "car dealers Geelong" on Google,will find my web site with latest stock details and pricing.- My strongest competitors already have web sites!That is how I am going to match and beat them in the competition.Q2.How am I going ...(related: Web Development)
From Search To Sale
The Internet car buyer is an elusive animal. Trying to hunt them down for the kill is not to be taken lightly. Dealers across the country continuously ask me what other dealers are doing to improve their closing ratios and CSI. I am constantly working to bring more traffic to their sites but as the old saying goes - "you can lead a horse to water, but you can't make...(related: Web Development)
Setting Up Your First Website
Q. Hey, Cathy: I'm just setting up a website. What should I do?A. First, don't call the web designer yet! Write out a detailed summary of your ideal client, if you haven't already done so. Get very clear on what b...(related: Web Development)
Writing Effective Alt Text For Images
Anyone who knows anything about web accessibility knows that images need alternative, or ALT, text assigned to them. This is because screen readers can't understand images, but rather read aloud the alternative text assigned to them. In Internet Explorer we can see this ALT text, simply by mousing over the image and looking at the yellow tooltip that appears. Other browsers (correctly) don't do this. The HTML for inserting ALT text is:img src="filename.gif" alt="Alternative description goes here"But surely there can't be a skill to writing ALT text for images? You just pop a description in there and you're good to go, right? Well, kind of. Sure, it's not rocket science, but there are a few guidelines you need to follow...S...(related: Web Development)
The Power Of Cpanel
cPanel is a control panel for your website and allows you to set up and manage your web account through a graphical interface instead of having to use command line. This means that you can make changes to your website without having to learn to use a command line environment. There are a variety of control panels out there, most offering a graphical interface and granting access to email management, FTP, subdomain administration, website statistics, etc. With a control panel, you can add/remo...(related: Web Development)
How To Promote Your Law Firm Website On The Internet For Maximum Profit
Making maximum profit from your law firm website is important, but as a lawyer you might not have any clue about search engine optimization and Internet marketing for your legal site. However, it is not so difficult to poise your website to be successful online even if you are not experienced with Internet marketing and driving website traffic. All you have to do is review the following tips and include them in your website marketing plan. Before you know it you will notice that your website counter is recording more hits per day and telling you that your directories, keywords, and links are working.Tip #1 - Submitting to Law DirectoriesTake some time online to orient yourself with the myriad of law directories available. Register your domain name and the type of law you practice with as many law directories as you possibly can. By ...(related: Web Development)
How To Listen On The Web
When building a relationship, listening is more important than talking.A website can reveal a great...(related: Web Development)
Why Local Service Companies Should Have A Website
The Internet is being used by local service business to improve sales today. Sales are improved because a website gives a company more cre...(related: Web Development)
Three Things Every Website Should Do
When I started my company in 2002, I knew I needed to have a website. Why? To provide credibility! How can a company be "real" in this day and age if it doesn't have a website? So, like many companies, I published an informational website that explained "here's who we are, and here's what we do".I didn't spend a lot of time worrying about my website. I certainly didn't think of it as a strategic weapon in my company's marketing arsenal. That started to change in the spring of 2004 when a newsletter was forwarded to me by a ...(related: Web Development)
Allocating Your Web Site?s Budget Properly
I had a client say something to me the other day that I thought was rather interesting. He mentioned that he almost considers SEO as a marketing expense even though its really a web expense. It was then tha...(related: Web Development)
Web Accessibility Myths
With more and more countries around the world passing laws about blind and disabled access to the Internet (including the Disability Discrimination Act in the UK), web accessibility has been thrown into the spotlight of the online community. This article attempt to put a stop to the misinformation that has been thrown around and tell you the truth behind web accessibility.1. Creating a text-only equivalent is suffi...(related: Web Development)
site-map - Copyright © 2006 Empower! Web Design | All Rights Reserved. | Web Development
