# How to use GeoStyling[“OutlineMap”] as GeoBackground for GeoHistogram?

Say I have some location data.

SeedRandom[123]
locs = GeoPosition[
Reverse[RandomPoint[Rectangle[{-88.6273, 29.6616}, {-84.2036, 32.7994}], 400], 2]]


I want to create a fully interactive GeoHistogram (with tooltips and other additions still functioning) but with a GeoStyling["OutlineMap"] specification for the states/provencies (EntityClass["AdministrativeDivision", "ADM2"]) within the GeoBounds of the data (plus any GeoPadding).

Unfortunately it appears that GeoBackground cannot be used as you cannot specify the geo-polygons directly or with an "AdministrativeDivision" class.

GeoHistogram[locs,
GeoBackground -> {GeoStyling["OutlineMap",
Directive[Lighter[LightGray, .25], EdgeForm[LightYellow]]],


You can however, create the backround and the histrogram separately and use Show but this appears to be broken.

With the map background you have to know what areas you are in since simply specifying EntityClass["AdministrativeDivision", "ADM2"]["Polygon"] starts the download of ten's of thousand's of polygons.

map =
GeoGraphics[{GeoStyling["OutlineMap",
Directive[Lighter[LightGray, .25], EdgeForm[LightYellow]]],
GeoBackground -> Lighter[LightBlue, .25],
GeoRange -> GeoBounds[locs],
]


Creating an none background for a GeoHistogram is easy enough.

geoHist =
GeoBackground -> None]


However it appears that Show does not work with GeoGraphics. It completely ignores the GeoBounds option. However, interactivity is preserved.

Show[map, geoHist]


Overlay works but kills the interactivity. Tooltips and other added functionality do not work.

Overlay[{map, geoHist}]


Therefore, I would like to know if there are some hidded options/features for GeoHistogram that will preserve interactivity while allowing a GeoStyling["OutlineMap"] specification at an "AdministrativeDivision" class level ("ADM1", "ADM2", or "ADM3") without having to EntityPrefetch all "AdministrativeDivision" "Polygon"s available. Any ideas? Also, confirmation on the apparent Show bug.

Mma 11.3.0 on Win 10 Ent

• Side note first, by setting the second layer as the active one you can preserve tooltips etc: Overlay[{map, geoHist}, All, 2] I'm not sure about geo options (and don't want to investigate) but if you repeat relevant ones in Show it looks ok too: Show[map, geoHist , GeoRange -> GeoBounds[locs] , GeoRangePadding -> Quantity[2, "AngularDegrees"] ] – Kuba May 9 '18 at 20:08
• This was an answer but I realized it does not address the question :) – Kuba May 9 '18 at 20:19
• @Kuba This Show and Overlay clarification is very helpful. Thanks. – Edmund May 9 '18 at 20:26

You could use this line at the Show statement...
Show[map, geoHist, GeoRange -> OptionValue[Options[geoHist], GeoRange]]