This topic is locked

Help with including a custom Google Map

7/10/2012 2:04:00 PM
PHPRunner General questions
D
dangdk author

Hi,
Some years ago I used the Google tutorial for making a google map based on a SQL database. This would allow for different markers according to the type of thing on the map. e.g. in my case I want one colour for buildings that are planned and another colour for those that are in construction.
I am not a programmer but I was able to understand some of the code and modify it for my needs.
I will explain very briefly how it works so help can be provided with my query.
The main php file (I will call it map.php) includes a javascript src for the google maps controls. It then assigns different pictures for the different icons.
It then uses a GDownloadURL command to access another php file (I will call it genxml.php)
genxml.php includes another php page to connect to the mySQL database and then uses a mySQL query. This query is static at the moment (i.e.just written out in the php file and doesnt change, I dont know how to make it dynamic).
The page then starts an XML file and iterates through the rows of the query printing XML nodes for each.
This xml data is then used by map.php to get the data needed to draw the markers on the map.
You can see an early version of the map here: http://www.carbolea.ul.ie/commercial_facility_map5.php
What I want to do is have this map on my PHPrunner list page and for the markers on it to change according to what is listed in the list box (the results of searches, filters etc.) e.g. all "in contrusction" items could be removed from the list via a filter and would then no longer appear on the map.
As I mentioned I am not a programmer so I am unsure what to do here. I guess there are 2 options but I dont know how to integrate either.
The first would be to somehow extract the SQL query used to construct the PHP runner list page and then use that in genxml.php
The other would be to use the data array returned by the query. If this is possible then a repeat of the SQL query would not be needed. How would this be integrated?
My other problem is that the page I linked to above is its own page that can include subfunctions etc. whereas I don't think this is possible in the Events page of PHPrunner. Would I need "include" these individual pages in some event instance in the list page? If so which one and how would it work?
Sorry for the long query but I bought PHPRunner on the hope I would sort this out. This is pretty much all I need the program for, everything else is pretty much complete now.
Thanks!!

C
cgphp 7/11/2012

You can include a big map on the list page using the Google maps widget: http://xlinesoft.com/phprunner/docs/insert_google_map.htm but you can't customize the marker appearence. Check this plugin for this kind of requirement: http://gmap3.net/