Gmap4 = View topos/aerials *offline* and your geolocation

Post general questions and discuss issues related to climbing.
no avatar
Jelf

 
Posts: 47
Joined: Thu Nov 26, 2009 10:41 pm
Thanked: 13 times in 8 posts

Gmap4 = View topos/aerials *offline* and your geolocation

by Jelf » Fri Sep 26, 2014 6:58 pm

I have posted here before about Gmap4 which is an enhanced Google map viewer that I developed. Embedded Gmap4 maps also appear on a number of SP peak pages. (Thanks to Josh Lewis for posting a 'how to'.) Up until this summer I believed that Gmap4 would not work if your mobile browser was offline.

I was wrong.

If you follow a few simple instructions, many (but not all) of the Gmap4 features will work just fine on a smartphone, tablet or other mobile device when you are offline. Among other things, when you are offline you can:
* Look at high resolution topo maps (t4 Topo High)
* Look at Google aerials
* Look at other basemaps
* Look at GIS overlays
* Turn on the geolocation feature (Menu ==> My location) and see the map become centered where you are standing
* Move and watch the location symbol follow you and the map automatically move as needed
* Touch the location symbol and see your coordinates in the current coordinate format
* Change the coordinate format
* Turn on/off a UTM grid
* Turn on/off a USNG grid

Yes, you can do all of the above while the browser in your smartphone or tablet is offline. Now let’s pop the hood and see how this works.

Any map you see with Gmap4 consists of a bunch of small image files called “tiles” that are stitched together to cover your screen. When you look at a map while you are online, a copy of each image file is saved in the browser’s cache. If you keep the browser tab open that has the Gmap4 map, then you can then go offline and still pan the map over the area for which there are map tiles in the browser’s cache. If you pan too far, the screen will be white.

To read plain English instructions that I guarantee you will understand (I don’t know how to write computer babble-speak) please visit the Gmap4 Help page and download the pdf file “How To Use Gmap4 Offline”.
Help page: http://www.mappingsupport.com/p/gmap4_help.html

From the Help page you can also find the FAQ, examples, a Quick Start guide (also on the Help page) and more.

Gmap4 default map: http://www.mappingsupport.com/p/gmap4.php

Joseph, the Gmap4 guy

The following user would like to thank Jelf for this post
Josh Lewis, ozarkmac

User Avatar
Josh Lewis

 
Posts: 3414
Joined: Thu Jan 06, 2011 11:12 pm
Thanked: 1111 times in 679 posts

Re: Gmap4 = View topos/aerials *offline* and your geolocatio

by Josh Lewis » Sun Sep 28, 2014 10:11 am

Thanks for keeping up the great work Joey. That's really cool to hear it works offline. I don't own a smart phone or any of those fancy gadgets. So it's able to save the location even though there are no url parameters passed to the map? I suppose this is because the map was not reloaded when opening the mobile browser. I'm curious what image types are being stored in the browsers cache?

no avatar
Jelf

 
Posts: 47
Joined: Thu Nov 26, 2009 10:41 pm
Thanked: 13 times in 8 posts

Re: Gmap4 = View topos/aerials *offline* and your geolocatio

by Jelf » Sun Sep 28, 2014 1:41 pm

Josh Lewis wrote:Thanks for keeping up the great work Joey. That's really cool to hear it works offline. I don't own a smart phone or any of those fancy gadgets. So it's able to save the location even though there are no url parameters passed to the map? I suppose this is because the map was not reloaded when opening the mobile browser. I'm curious what image types are being stored in the browsers cache?


Josh, we are all looking forward to seeing an updated profile pic where you are wearing a pack again.

Most smartphones have GPS chips. That chip can get data from the GPS satellites and determine your position - exactly like a dedicated GPS device. A browser that complies with the HTML5 specs can get the location form the GPS chip and give it to javascript running in the browser. The browser does not have to be online in order for this to work.

Note that the javascript does not talk to the GPS chip directly. If the smartphone can also see any cell towers and/or wi-fi hotspots that that data will also be used to determine the coordinates for your position but that extra data is not essential.

Each map that is displayed on the screen is a series of jpg or png files. 1 file = 1 tiles. Each tile is 256 pixels x 256 pixels. These image files are stored in the browser's cache. Thus, if you pan the map while online over an area where you are going to do a trip, then you can continue to look at that same area while offline. Why? Because by panning the map over that area while online, a copy of those map tiles was saved in the browser's cache.

Note that the cache will go away if the phone is turned off, or the browser tab with Gmap4 is closed or if the browser crashes.

And of course Gmap4 can only be started when the browser is online since it needs to download some code from Google's servers.

No matter what gadgets anyone carrries on a trip I believe you should always have a copy of the best paper map available, a compass and know how to use those tools.

User Avatar
Josh Lewis

 
Posts: 3414
Joined: Thu Jan 06, 2011 11:12 pm
Thanked: 1111 times in 679 posts

Re: Gmap4 = View topos/aerials *offline* and your geolocatio

by Josh Lewis » Sun Sep 28, 2014 9:15 pm

Jelf wrote:Josh, we are all looking forward to seeing an updated profile pic where you are wearing a pack again.


Thanks. It's going to be a while, at first I probably won't be able to wear a pack when I do start up. I can walk to the store, but I cannot carry any groceries. :( My brother (assistant) did the Persis Index Traverse yesterday. I couldn't eat much because I am still not capable of preparing my own meals. When I'm hurting less I plan on changing my profile pic.

Jelf wrote:Note that the cache will go away if the phone is turned off


Is this because it's the standard behavior of a mobible phone to flush out the cache upon closing the browser? If only they had better hard drives. :wink: If there was a way to have the cache saved and Google's little script to run the maps, it could be turned off with still saving the maps. Google Maps now changes the url coordinates as you navigate which I consider a smart move on their end.

The reason it's kinda a big deal to keep the browser open is because we have to consider power consumption. Nothing like having your navigator run out of power in a white out way up on a tricky mountains. :P I'm sorta joking considering that I don't use navigation toys in the mountains.

no avatar
Jelf

 
Posts: 47
Joined: Thu Nov 26, 2009 10:41 pm
Thanked: 13 times in 8 posts

Re: Gmap4 = View topos/aerials *offline* and your geolocatio

by Jelf » Mon Sep 29, 2014 1:09 pm

Hmmm....you make a good point. I may have mis-spoke.
Actually I do not know if a mobile browser flushes the cache when the browser (or browser tab) is closed.

However, there is a bigger issue. Gmap4 can only be started when the browser is online so the Google map API code can be downloaded from Google's servers.

Also it would violate Google's TOS for me to write my own code to cache map tiles that are hosted on Google's servers.

And the best way to extend battery life is to turn the GPS off. When you want to check your position with Gmap4, turn the GPS on and do Menu ==> My location then turn the GPS off again.

User Avatar
Josh Lewis

 
Posts: 3414
Joined: Thu Jan 06, 2011 11:12 pm
Thanked: 1111 times in 679 posts

Re: Gmap4 = View topos/aerials *offline* and your geolocatio

by Josh Lewis » Mon Sep 29, 2014 7:35 pm

Jelf wrote:And the best way to extend battery life is to turn the GPS off.


What about airplane mode on the way to the hike/climb?

no avatar
Jelf

 
Posts: 47
Joined: Thu Nov 26, 2009 10:41 pm
Thanked: 13 times in 8 posts

Re: Gmap4 = View topos/aerials *offline* and your geolocatio

by Jelf » Mon Sep 29, 2014 7:52 pm

I just tested that on an iPhone 4s with iOS 7.

While online via wifi I panned the map over a bunch of topo map tiles.
Turned on airplane mode.
I can continue to pan over the tiles that are in the browser's cache.

However, in airplane mode my GPS is off. Yes, I can go into settings and turn it on.
But geolocation still does not work.

But you raise a good question.

Does a phone in airplane mode use less power than a phone that is on but has its GPS turned off?
I would like to know the answer.

The following user would like to thank Jelf for this post
Josh Lewis

User Avatar
mvs

 
Posts: 1054
Joined: Tue Oct 23, 2001 7:44 pm
Thanked: 307 times in 123 posts

Re: Gmap4 = View topos/aerials *offline* and your geolocatio

by mvs » Wed Oct 01, 2014 2:41 pm

Nice to see such development, and good to see Josh at least thinking about getting out there! :D

I really like OruxMaps on my Android phone, and have come to appreciate the open source mapping world. You can download tiles and customize maps in all kinds of ways. I also like that OpenStreetMap allows coding of all kinds of mountain terrain features which can be useful to specialists like us. The 4umaps.eu rendering of the OpenStreetMap data is especially nice for hikers.


Return to General

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests