Hi, when a user clicks on one of the small point of interest type icon links on the maps they see a pop up with info. The user can then click on the "more information" link in the popup to see a web page with further information.
When the user does this there's no way to return to the web map view of the TTMSFMXWebGMap.
Is there a built in way or a code snippet that will allow the user to go back to the map?
The more information link is currently opened inside the webgmaps webbrowser instance. We will have to investigate if it is technically possible to intercept this and redirect the URL to open in safari instead. Currently there is no way to return to the map.
In the latest release (1.8.0.3), you can implement the OnBeforeNavigate event and return cancel := true when a redirection occurs to a http formatted url, such as the link in the popup window:
The same event will allow me to cancel any "Popup Window" derived from the click over the map hot spots, like restaurants, gyms, or any other object inside de Map that retrieves Popup Windows?
I haven't taken a look at it, but at first sight, the popup window doesn't generate a OnBeforeNavigate event. I think it will require a javascript implementation that we will have to expose through the MapOptions property. We will investigate this here as soon as possible.
Also How can I draw a circle over the TMSFMXWebGMap in the center, and this center remains the entire session of my program, I want this object be unamovable can you point me in the right direction please?
In the latest version, you should be able to disable POI completely with the property MapOptions.DisablePOI. If you want POI to be visible but catch the more information url redirection you can use the beforenavigate as you already found out.
Hi Pieter, I have a small bug with this mechanism for disabling the POI clicks.
If I use the code snippet in the before navigate event:
if Params.URL.Contains('http') then
Params.Cancel := True;
The "more info" links are disabled as expected. However if there's a street view image on the POI popup window then clicking on the street view image crashes my app.
Is there some additional code that I should use to make the street view image links safe?
------------
Also I'm trying a method to intercept the URL and use it in a separate TWebBrowser. However I find that it's not working. Note that my web map and web browser are on two separate TTabItem tabs on a TTabControl. So I'm trying to slide to: hide the map, slide to a new tab, then navigate to the URL using a TWebBrowser.
What I'm seeing is that the tab slide works, but the WebMap remains visible. Any ideas?
It seems that the default FMX TWebBrowser is interfering with the way the TTMSFMXWebGMaps is showing. To display the URL on a separate tab, you can use the TTMSFMXWebBrowser in the TMS Pack for FireMonkey, or you can use another instance of the TTMSFMXWebGMaps.
You will need to initialize the TMSFMXWebBrowser or the second TTMSFMXWebGMaps visible false,
and toggle them as you switch pages in the tab. the visiblity is not automatically intercepted as both controls are real native Android controls and do not hook in to the FMX hierarchy.
Hi Pieter, this approach works nicely. I can pop open "more info" links in the second TTMSFMXWebGMaps instance.
But... there's still an issue with the streetview link on the info pop up. I'm seeing "NaN is not a valid integer value" errors popping up. The debugger shows that happening when the Params.URL is:
We have investigated this here and have applied a fix for this, the next version will address this issue. If you wish to have an incremental source update, please contact us by email.