This is a follow-up question based on the answer I got from Lukas Lang. The original question is here. How can I alter the code to deploy it on the cloud? Or in case this method is only for desktop: how can I replicate this idea for cloud deploy?
CountrySelector[c_, opts : OptionsPattern[]] :=
iCountrySelector[#, c, opts] &
CountrySelector[Dynamic@var_, c_, opts : OptionsPattern[]] :=
iCountrySelector[Dynamic@var, c, opts]
iCountrySelector[Dynamic@var_, c_, opts : OptionsPattern[]] :=
DynamicModule[
{
control = Panel@Row@{
"Loading country selector...",
ProgressIndicator[Appearance -> "Percolate"]
}
},
Dynamic@control,
Initialization :> SessionSubmit[
control = DynamicModule[
{active, countries = c},
GeoGraphics[
{
MapIndexed[
EventHandler[
Style[
Annotation[Polygon@#, ""],
TagBoxOptions -> {
BaseStyle -> FEPrivate`Which[
FEPrivate`SameQ[active, #2[[1]]],
{Lighter@Red, EdgeForm@{Thick, Red}},
FrontEnd`CurrentValue@"MouseOver",
EdgeForm@Lighter@Red,
True,
{}
]
}
],
{
"MouseClicked" :> (FEPrivate`Set[active, #2[[1]]]; var = #)
}
] &,
countries
]
},
opts,
GeoBackground -> "CountryBorders",
ImageSize -> Medium
]
]
]
]
Manipulate[
Dynamic@country,
{{country, None}, CountrySelector@EntityList@EntityClass["Country", "Europe"]}
]
I am looking for any advice or just a point in the right direction.
EntityList@EntityClass["Country", "Europe"]
? Moreover, I am afraid thatFEPrivate`
functionality is not supported in the cloud so you need to useBasetStyle -> Dynamic @ Which[....
instead. There's no 100% guarantee it will work so at the end you may need to haveDynamic
wrapped around everything. $\endgroup$