GEO Services II
It’s been three weeks since I last posted here, or anywhere else I think. I’ve been working on the new project daily since the last post and it seems when I get intensely preoccupied on something everything else takes a backseat. It’s how I’m wired. But today I have an update.
The new WordPress plugin I am writing is not yet complete but it is getting close. I had a major hangup this past week that set me back several days. I was having much difficulty getting an ajax response from MySQL via the WordPress framework. I am using a wrapper class called SACK (Simple Ajax Code Kit) that is included with WordPress to handle the ajax requests and unfortunately I spent a day or so trying to understand SACK since I thought my problem was with how I had implemented the callback function or something. The good news I guess is that SACK works exactly as advertised and was not the problem. For simple ajax requests, I recommend SACK highly. Simple, yet versatile.
Loading a Google map with ajax came off without a hitch but when I tried to get a list of marker items from the database to overlay onto the map I was coming up blank. Sending an ajax request to a script on the server and getting results worked as expected but when I tried sending through the WordPress wp_ajax_ action hook there was a glitch: The xml data simply would not come back and I had a dickens of a time pinpointing the problem spot in the process.
I tried many things and had to do some tricky debugging to see what was happening on the server when the ajax script was called. After writing some code that injected log messages into a MySql table I determined that the ajax action was never executing at all. Why? Well, just be sure to send your cookie info with the ajax request. D’oh!
It took almost five days to finally solve the problem but that is all in the past. In the process I learned a lot about generating valid xml and how to properly call a WordPress Ajax action hook, not to mention intimate knowledge of the SACK wrapper class and the XMLHttpRequest object which it wraps. All good stuff.
Which brings us to the current status update. All that is left now are some functions to import and export map data, styling the admin screens, adding a widget for publishing maps to the front end, cleaning up the code, and setting up a support page on the distribution site, GulfCoastGeocache.com, and the first beta version of the Private Geocache Manager plugin will be available for download and installation. I reckon the import and export will take the most time but certainly by the end of the week I will have a much better idea of when the code will be released.
The inital beta version of the plugin will be very simple compared to the planned final version but it will be sufficient to create, import, export and manage one or more lists of geographical markers, along with the appropriate map interfaces for creating and viewing overlays.
