One Last Change to the Charts

Dive Sites - pick your starting point

Since starting the site, I used charts with white water and gray land, and when I re-built all the charts in OpenLayers, it was easy enough to duplicate that. But I noticed that when you print a page, the gray land disappears. I have never found any documentation on the OpenLayers json map specifications, but I picked-apart some examples and eventually hacked-together a solution where the land is green and it does print. So hooray for that.

If your charts are still gray, you need to do a 'hard reload' of the page: hold the shift key down while clicking the refresh button in your browser. The more I look at it, the more I like the green.

All-in-all, these OpenLayers maps are terrific. My initial worry was server overloading. That is simply not a problem. In fact, the server-side performance is so good that, while I would normally cache things that are used repeatedly, like menus, I don't see much point in caching the scripts that generate the charts. Each one is just a single database query and some very fast processing. It would be difficult to come up with a bullet-proof caching scheme anyway.

Client-side rendering was also a concern, but I have not seen a problem in any modern browser on any platform, even on my phone. Certain map sources have rendering glitches on certain browsers; I just don't use those sources. Otherwise, all the outside map sources I have tried have been reliable and fast. Very fast since I eliminated all the land-side data like roads and places.

Cost is also not a problem. I ditched Google the first time they sent me a bill. They are the last people I want reaching into my pocket! The free maps I am using now are better anyway. Google has way too much advertising.

I wrote all the code to integrate OpenLayers with WordPress myself. I started with a bought 'plugin'. I began finding and fixing bugs in that, and writing extensions for it. I sent all my very easy bug fixes to the authors of the plugin, and to date they have not implemented a single one. I became dissatisfied with that, so I tried writing my own replacement 'core', at first just to see if I could. I got the basic part working pretty quickly, much to my surprise. That grew in polish and capabilities until it was better (for my purposes) than the code I bought, so I switched to it.

If I wrote out a specification for everything I ultimately did, I would look at it and say "No way" and not even try. So the whole thing really happened by accident. I took nothing from the package I bought except inspiration. I am still stunned at how well all of this works.

On a side note, NOAA used to publish all their charts as beautiful detailed pdf files that you could download and keep on your computer. They stopped doing that, now all the charts are in some online format that is hard to use and not portable at all. I am keeping my old pdfs! All the more reason to make my own system. Very bad on NOAA, they should continue to offer the pdfs as an option. This decision was probably made by some desk-bound bureaucrat who gets seasick in his bathtub.


USS Algol reef
The Algol just prior to sinking, November 1991.
Type:
artificial reef, Andromeda class attack transport ( freighter ), U.S. Navy, also known as a "Victory Ship", although often incorrectly referred to as a Liberty Ship
Name:
One of a series of Navy transports named for stars;
Algol is a star in the constellation Perseus, also known as the Demon star.
Built:
1943; Oakland CA USA, as James Barnes
Specs:
( 459 x 63 ft ) 13910 displacement tons, 429 crew *
* this figure almost certainly includes embarked Marines
Sponsor:
Federal Aid in Sportfish Restoration
Sunk:
Thursday November 22, 1991 - Sea Girt Artificial Reef
GPS:
40°06.545' -73°41.450'
Depth:
145 ft +, starts at 70 ft, main deck at 110 ft

Printed from njscuba.net