@ josh901
Oh, sorry forgot the link.
http://sandbox.connections-pro.com/geo-prototype/
Not much to see yet honestly, most work is under the hood. It may or may not be working, throwing errors and such when/if you visit.
Here’s some nitty gritty details of what I’m doing…
First I researched…
As part of my research I looked at what others, my competitors if you will, were doing and how they were accomplishing it. What I learned was that they all are not doing it right … well, in my opinion at least. They’re all using AJAX to handle requests and updating the map without having to have the page refresh which is great for user experience which is exactly what I was planning to do myself.
But things break down after that…
To verifying degrees they all include a multitude of third party javascript libraries which is itself is not bad, I do too with Connections. The thing is WordPress also ships with many javascript libraries (which are also third party in many cases) that do the same function. What this means to you is they include things making their plugins “heavier”. The goal should be, if WordPress ships with it you should use it to keep things as slim as possible.
Overall it’s pretty minor, but wanted to point it out.
On to other things I’ve found…
Basically others used one of two methods to load data in the map. The one group loaded it embedded in the page as the page is being created. The other group loaded it in the map after the page has loaded via AJAX. The former is really, really, really bad. The more data you have the slower the page will load. It simply will not scale. The later is not only the better way, it really should be the only way.
Those that did it with AJAX, to my surprise was not returning data back as JSON. Basically they were returning back pre rendered HTML segments which may or not be combined with more HTML segments hard coded within the javascript. What this means it makes it next to impossible for users to tweak the design unless they’re very skilled in HTML, PHP and JavaScript. My solution will be to use JSON with no hard coded HTML within the javascript. This will make it a lighter and faster solution.
You may or maynot know what JSON, if you do not, it is basically a simple easy to read way to structure your data that is very widely supported. Within the JSON spec there are sub-standards, one being GeoJSON. This is simply a specific way to format geo data, for example, data from a directory. It so happens that Google Maps supports this natively. The spec is actually really sparse, basically only supporting name, latitude and longitude for feature points (a directory entry). It does have a properties value where more data about the point can be added. This is where the rest of the entry data will be stored in my GeoJSON responses. The rest of the entry details will adhere to the JSON-LD spec. This is basically a way to represent http://schema.org data within JSON which is backed by all the search giants. By utilizing both GeoJSON and JSON-LD standards not only makes it easier for me to do other things I have planned but also makes Connections compatible with the large ecosystem of other web apps that utilize them.
So… that how I’m planning on handling AJAX requests… now, how to display it…
Like I said the others are returning pre rendered HTML and combining it with hard coded HTML within their javascript. My plans are to use a JavaScript templating engine. Guess what? WordPress just happens to ship with one built in which is used throughout the admin. What is great about this I can use the templating API I built for templates in Connections to register and load the javascript templates. This makes is easy to for me to add and even offer new templates customize the map info windows and results in the future. This also make it easier for a user to tweak any part of what I’m building using methods I’ve already documented for custom CSS and template override files.
Long and detailed response, I know … and that was just the birds eye view!