

$text = "%e2%bc%80" //default google map icon $color = "ff776b" //default google map color I have modified the script to redirect to Google’s dynamic markers (yes, Google has the equivalent) hopefully that will take some of the load off, and I won’t need to remove it totally. Hosting of these dynamic markers, linked on NumericIcons is using all my allocated hosting server resources.

$im = imagecreatefromstring ($image_string) Replace the above with the below modification $image_name = "$color,$color,000000&ext=.png" Ĭurl_setopt ($ch, CURLOPT_URL, $image_name) Ĭurl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0) Ĭurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1) Ĭurl_setopt($ch, CURLOPT_BINARYTRANSFER, 1) I have experienced some users with errors produced by the imagecreatefrompng, either due to versions <4.3.0 disabling remote file access or allow_url_fopen being disabled.Ī greater supported alternative is to use curl to fetch the Google marker.
#Google maps cool icons code#
Have a look at the PHP source code below: Update: it looks like in Internet Explorer the transparencies are incorrectly displayed, this is not the case when displayed on a Google Map. You will need to download the modified arial font and host it in the same directory.
#Google maps cool icons manual#
All main characters 0-9 and A-Z I have added manual offsets, this could be improved. Unfortunately, not all symbols work (not sure why, even though they are in the font) and if the symbol doesn’t work it will default to the default bullet (this is done with a modified font file).Īlso there may be an issue with alignment. Now that gets a little boring, how about some color: Hence, I provide a little demo of some PHP code that does this that I quickly whipped up. But why not take this a step further and add dynamically generated text as well. Google has gone in the right step their MapIconMaker allowing very customisable markers using the Charts API marker output. I am a avid fan of Google’s Map API, have even have created my own WordPress Google Maps plug-in ( thydzikGoogleMap), but one feature that I find lacking are customisable markers, with the need to include an image file for every customisable marker, now if you want a selection of colours and labels this creates a huge image database.
