Phoogle Modified Class for Google Maps

I was looking for a php class to use on Rockit.it to geo reference band, festivals, labels and other stuff.…

November 9, 2009

I was looking for a php class to use on Rockit.it to geo reference band, festivals, labels and other stuff. I found a pretty good one, named Phoogle. This class is easy to connect with db or other stuff, but there isn’t support for customizing the google map markers.
So I wrote an Icon class and I’ve placed it inside the phoogle.php file, then I’ve modified the phoogle class to use my Icon class.

I’ve also addeded the javascropt Clusterer2 class found on Acme site. It helps managing thousands of markers on the same map by clustering them together when you zoom out. To incorporate this class into the php class I’ve added a property that enables the use of the clusterer2.js file.
It works great now with a lot of markers.

I’ve modified the array containg points to handle also ajax callbacks, so if there are a lot of points you don’t have to put the info html in the page but you can call an external file to retrive the html info to display in the tag. Or simply, you can customize the action on the click on the marker.

Finally, I’ve added a fullscreen GControl I’ve written that allow user to make the map fullscreen.
To use it in the php class just turn it on by setting to true the showFSbutton propertie and include the fsaddon.js and the famous prototype.js file.
To make this control works you also have to call the html element that contains the map “mapcontainer” or you have to set the “mapContainerId” properties to match your container element.
That’s all.

Example 1: (try it | source)
A map with two custom icons and uses full screen GControl to add the “Full Screen” button.

Example 2: (try it | source)
The html info window displays an html retrived when you click on the marker.

Example 3: (try it | source)
Add 2 thousands of markers and handle them without slowing down the browser. Zoom out to see clustering. The markers are shown only when your map need to show them, not when they are out.

Download rar file here.

This rar contains:

  • phoogle2.php
  • Clusterer2.js
  • fsaddon.js
  • prototype.js

Working demos:

Phoogle modified is used here and here.

Author

I'm a software engineer, an everyday web developer and a maker. I usually build sites with PHP, within or without WordPress. I build Internet of Things with Arduino and ESP8266. I'm the founder of Rockit.it and Dailybest.it and I'm actually the Chief Technical Officer of Better Days web agency.

Comments on “Phoogle Modified Class for Google Maps”

Recommended

Full Screen GControl for Google Maps

Use with phoogle modified class: (see an example here) To use it in the phoogle modified class just turn it…

November 13, 2009

Clustering many markers with Google Maps v3

I’ve found this blog where Matthias Burtscher converted the Marker Cluster (like the Phoogle2) for Google Maps API v.3. Since…

December 13, 2009

PHP Geocoding function, from address to coordinates lat long

This is a small function included in the Minibots Class that converts an address to a couple of coordinates Latitude,…

January 24, 2011

Decimal Degrees conversion and distance of two points on google map

Those two functions are usefull when you’re making Google Maps applications: When you show the coordinates of a point, it’s…

December 26, 2009

Javascript Ruler for Google Maps v3 to measure distance on map

Javascript example for measuring distances on a Google Maps with a ruler.

December 19, 2009

Two post types share the same taxonomy in WordPress

Sharing a WordPress taxonomy between two post types is useful especially if you want to create a relation between different…

November 14, 2019