MGRS Layer for Google Earth – Offline!

Thanks to help from Mark Ferneau, have finally the MGRS layer packaged up ready for use off-line (and GPL licenced!), an often requested feature.

These instructions assume Windows, and that you don’t have a local webserver running. The zip file should be usable to set it up on any local server capable of running PHP, just don’t forget to edit the link in the network link to the path of your webserver.

Without further ado, the instructions:

  1. Download Appweb web server from: (Tested with 2.2.0)
  2. Install with the general default options
  3. Save AppWeb.conf file in C:\program files\MBedthis Appweb\, overwriting the default (this just sets up the minimum needed for PHP to run, removing some of the extra stuff)
  4. Copy php5ts.dll from C:\Program Files\Mbedthis Appweb\lib\modules\ to C:\Program Files\Mbedthis Appweb\bin\ (not sure why this step is required but Appweb seems to need it)
  5. Extract into directory C:\appweb\web\offline_nearby\
  6. Start up the appweb server, using Icon in Start Menu. (if it’s already running, icon in System Tray, exit it)
  7. Open the network link – save it to your My Places :)

If there is interest could possible package up some of the other layers run on a local webserver in a similar fashion.

Finally, use at your own risk, it works for us, but your mileage may vary. We welcome any and all feedback (esp. patches!)

17 Responses to “MGRS Layer for Google Earth – Offline!”

  1. LWC says:

    Dude, you’re a genious! Do you realize you are the only person in the entire world who (at least publically) solved the lack of PHP support in AppWeb?

    Every PHP user of AppWeb should be grateful that one day you woke up and decided you wanted to use Google Earth offline…

    As you can see by my attached link (which also contains the right code for appweb.conf – yours has gone 404), I’ve posted your solution in the official forum. I hope it’ll finally give the admins enough motivation to officially fix it.

    I only wish somehow using Google Earth offline would have forced you to solve the fact AppWeb hardcodes its default folder in some of its files.

    Thanks again on behalf of the users of AppWeb who want to use PHP in it.

  2. Barry says:

    It was actully Mark, who forwarded me the fix (and did hard work of sourcing and configuring AppWeb in the first place), but sure glad to have helped you out.

    Also thanks for the heads up about the conf file, I think a case issue, (this server is linux so case sensitive) renamed the file as needed.

    I’ve been using a local version of Apache (the latest computer using WAMP) for things like this for a long time, but it was Mark who suggested using AppWeb, as it seems a nice simple solution to get a local webserver up and running.

  3. [...] So the server hosted version has been updated, and also the file inside the zip for the offline version (which are in fact identical code!), and if really interested heres the diff. [...]

  4. BIG TOM says:

    I dont understand where to save the network link in my places? where is that?

  5. BIG TOM says:

    also where do i get this file from :

  6. BIG TOM says:

    ok got the app web file done
    however now i am getting a fetch of network link connect failed then it asks me if i want to stop fetching ignore or continue

  7. Barry says:

    Tom, have you got the AppWeb application actully running?

    I think it shows a Icon in the Tray beside the clock. If it shows there try closing it, and then starting it again using the item in your Start Menu.

  8. Munir says:


    Already a great implementation.

    Any idea how to implement a similar project for dispaly of other projected coordinates specific to country’s grid. I require it for a project to display Lambert Conformal Conical projection. Regards.

  9. Barry says:

    The UTM and MGRS layers are already conversions from British National Grid (and Irish Grid).

    Its all about the maths, if you can get a coordinate conversion system, then it should be possible.

    Its slightly different for simply a projection, as its still lat/long based system, just how the ‘grid’ is distorted.
    So if you can get a conversion between lat/long and absolute position on a projected map then it should be possible by using that conversion backwards. (basically get the php source to conversion on the Australian government site here)

  10. Do you have some suggestions or requested changes for appweb. We’re doing 3.0 now and would love to make changes to make this neat solution work more easily with appweb.


  11. Does this have to run on a server or can I run it on my computer (WinXp)and have the MGRS grid load correctly in Gooogle Earth Pro?

  12. Barry says:


    Yes you can run this on your own machine (the same machine that is running GE) – I built and tested it on my Laptop :)

  13. Rob says:

    Hi Barry, I have installed the appwebserver with no issues. I have loaded the network link but I cant get it to work. All I get is an error msg. Any assistance would be greatly appreciated

  14. I have noticed that if I try and edit the color or width of say the 100km MGRS/UTM Grid lines or edit the size of type in the lables folder, it breaks the program “MGRS Gridlines by” and I have to load it again into Google Earth. Of course I see the “Edit limited to part of Multi Geometery collection” notice, but then whom am I to not try and see what I can change to the way I want something to work? Why can I only edit the firrst item? Yes I am whinning, with out whinning nothing will change….hahahah. Really thanks for making this in the first place, No, Really thanks…

  15. Alex says:

    I got your online kml version to work, but I’m having problems seeing the MGRS grid in the offline version. I can verify that my AppWeb server is serving the grid_mgrs.kmz.php file by browsing to http://localhost:8082/offline_nearby/grid_mgrs/grid_mgrs.kmz.php and it prints “Please zoom in to plot GridLines 1 “. Then I add the same URL as a network link in Google Earth. The link shows a green dot for “connected” but when I zoom in to plot the gridlines, the dot turns yellow and no grids ever get plotted.

    I followed the above instructions, except I had to change all references of ‘Mbedthis’ to ‘Embedthis’ in the conf file, and I didn’t have to copy the php dll to the /bin directory because it was already in there. I suppose AppWeb Server has changed a bit since this article was written.

    Thanks for your work on this.

  16. bill mcbride says:

    have not been able to get the server started. running windows 7 ultimate.

    tried to follow the above comments and make changes to the .conf file to reflect the newer version of Embedthis AppWeb . i get an error on trying to start saying “can’t open service”. any help or advice appreciated



  17. Yves says:

    Great work!

    However when I run it with version 3, it seems that the zip library is not enabled.

    I get a fatal error with Call to undefined function gzcompress()

    Any idea how to enable it.