Robs Programming Junk
Welcome to my programming blog!With some luck you will find some tasty nuggets of information here. If you do find something please post a comment on where or how you used it. I like to see what sort of impact my work has on others.
Saturday, January 05, 2008
Google Mapplets and Custom Writeable Pushpins
Well, I came up with some simple and yet incredible code for Google Maps or Google Mapplets. I think this is just brilliant but you may think otherwise.
Ever wanted to put something on those push pins other than a number or a custom graphic. Well low and behold I did this recently and it's pretty simple. If youre familiar with PHP you'll say to yourself why didnt I think of that.
So let's review what we have here. Lines 2-5 are basic sanity checking for a "rate" which is nothing more than a number.
CODE:
Line 6 is changing the response type for this PHP script to an image.
Line 7 loads up a base image to write text to.
Line 11 put's the text onto the pushpin.
Line 12 Returns the image
That's it folks. Now you have some very cool push pins for google maps. What do you put on them? Well that is up to you. I used "rate" data from banks. You could in theroy put names of things, locations, anything. One template image is used then from there you write the text you want onto the graphic.
This DOES support transparency by the way. I needed that myself. One thing though is that IE6 doesnt support PNG transparency the right way so if you do this you might want to use a GIF instead of a PNG.
If you find this useful please post something on this blog. I'd just like to see how this is being used.
Ever wanted to put something on those push pins other than a number or a custom graphic. Well low and behold I did this recently and it's pretty simple. If youre familiar with PHP you'll say to yourself why didnt I think of that.
So let's review what we have here. Lines 2-5 are basic sanity checking for a "rate" which is nothing more than a number.
CODE:
Line 6 is changing the response type for this PHP script to an image.
Line 7 loads up a base image to write text to.
Line 11 put's the text onto the pushpin.
Line 12 Returns the image
That's it folks. Now you have some very cool push pins for google maps. What do you put on them? Well that is up to you. I used "rate" data from banks. You could in theroy put names of things, locations, anything. One template image is used then from there you write the text you want onto the graphic.
This DOES support transparency by the way. I needed that myself. One thing though is that IE6 doesnt support PNG transparency the right way so if you do this you might want to use a GIF instead of a PNG.
If you find this useful please post something on this blog. I'd just like to see how this is being used.
View my portfolio at iFreelance.com
Hire MechSoftware for Quality Assurance (QA), Database Programming, and Security Design/Programming
Find QA Freelance Jobs at iFreelance.com
Hire MechSoftware for Quality Assurance (QA), Database Programming, and Security Design/Programming
Find QA Freelance Jobs at iFreelance.com
Recent Posts
Well this blog has been fairly inactive since I've...
Starting EJB Certification
Passed SCJP 1.5
SCJP Exam
Test From Brainbench
Java code snippet for ODBC connections.
SCJP Study continues
Rob's Timers
Studying for the SCJP
The Easter Egg
Archives
01/01/2005 - 02/01/200502/01/2006 - 03/01/2006
03/01/2006 - 04/01/2006
04/01/2006 - 05/01/2006
05/01/2006 - 06/01/2006
09/01/2006 - 10/01/2006
10/01/2006 - 11/01/2006
11/01/2006 - 12/01/2006
12/01/2006 - 01/01/2007
04/01/2007 - 05/01/2007
05/01/2007 - 06/01/2007
01/01/2008 - 02/01/2008
02/01/2008 - 03/01/2008
05/01/2008 - 06/01/2008
06/01/2008 - 07/01/2008
08/01/2008 - 09/01/2008
09/01/2008 - 10/01/2008
11/01/2008 - 12/01/2008
12/01/2008 - 01/01/2009
01/01/2009 - 02/01/2009
02/01/2009 - 03/01/2009
04/01/2009 - 05/01/2009
05/01/2009 - 06/01/2009
07/01/2009 - 08/01/2009
01/01/2010 - 02/01/2010
My Software
Blinky - GBPVR PluginPhotoCopy - GBPVR Plugin
QTC - Quick Test Case
rBoop - Rob's Timers
Programming Links
C# FormatterNSIS
Other Links
Damn Small LinuxSites I Manage
Do it yourself SEO. Cheap.Pet Supplies
Dog toy of the month club
SqueakerZ pet Deals
Geocaching Community
Hitch hiker Tracking