[Google Maps by LxIS] Problem refreshing page with map

[Google Maps by LxIS] Problem refreshing page with map

  
Forge Component
(7)
Published on 2014-07-21 by Filipe Martins
7 votes
Published on 2014-07-21 by Filipe Martins
I installed some code from the community to do an auto refresh on a timer and when it runs, the map disappears. Has anyone seen this? Know how to fix it?
Thanks,
Gerry
Hi Gerry,

How are you refreshing the map? Are you using the component action RefreshShowMultiplesMarkersMap or RefreshShowMultipleLinesMap (depending on the map you're using)?
I am using it, but I now get an error:

An exception occurred in the client script.
Error: google is not defined


On manual refresh of the page, I have also seen error:

An exception occurred in the client script.
Error: google.maps.InfoWindow is not a constructor


Do you know what could be causing this? Do you know how to fix it? I'm using Firefox.
Here's an example eSpace...
Hi Gerry,

I noticed you use some code to set an auto refresh on the map and set some other attributes.

Is a solution like this one (i changed your example eSpace) suitable for your needs?
Can you please give me a V7 version? We are not on V8 yet.
Unfortunately I can't provide a V7 version.

However, the change in the espace was just replacing your custom javascript code with this one:

"<script type=""text/javascript"">
    setInterval(function () {document.getElementById('" + HiddenButton.Id + "').click();}, " + Miliseconds + ");
</script>"
That seems to work better. Thank you very much!
Hi everyone,
It's my first time using the agile platform so I want to apologize in advance if this is a newbie error.

I'm using the LxIS Google Maps component to allow the user to draw a polygon in the map and therefore the coordinates of said polygon can be saved into the database.
However before the drawing, I want to center the map at a given place. This place is introduced by the user in a input widget, then clicks the button "search" (AJAX Submit, destination - action "LocalPrep"). The screen action assigns the coordinates to local variables (CenterLat, CentarLng) in the web block where the map widget is and then refreshes the map widget with AJAX Refresh. The map widget has that local variables as input parameters.

The problem seems to happen whenever the AJAX Refresh happens. The first time loading the page it loads the map just fine, but when clicking the "search" button the map just disappears. Using debugger I see the local variables with correct values but when it reaches AJAX Refresh "-unavailable in current context-" message appears.

Sorry if this is to extensive but just wanted to explain everything to make it easier for you to help me.

Thanks!
Hi Cristiana,

Unfortunately, with the GoogleMapDrawPolygon webblock, you can only define the initial CenterLat and CenterLng parameters when the webclock is first loaded.

What I would suggest, as a workaround, is for you to ask the user the center coordinates first and then pass those values to a new page where you can then load the GoogleMapDrawPolygon webblock with those given coordinates.
Hi all,

can you tell me please how can I refresh the "GoogleMapShowMarker"  web block in the same page with diferent coordinates? Or another option that can provide the same result. I'm trying to refresh a map but i'm not getting a succefull result, the map always disapear....

Thanks

Hi all again,

using the function "RefreshShowMultipleMarkersMap" how can we choose the zoom that we want to show on the new load? When the weblock load the first time exist that option but when we refresh the map the  zoom value its the default for a marker only. How can we change de zoom value after refreshing the map?

Thanks in advance.

Cheers 
Gonçalo Azambujo wrote:
Hi all again,

using the function "RefreshShowMultipleMarkersMap" how can we choose the zoom that we want to show on the new load? When the weblock load the first time exist that option but when we refresh the map the  zoom value its the default for a marker only. How can we change de zoom value after refreshing the map?

Thanks in advance.

Cheers 
 Hi Gonçalo,

Ran into the same problem, my solution was to use the runjavascript method after the maps refresh method and provide the following instruction: "map.setZoom(14);"to the RunJavascript. Hope this helps.

Best Regards,
Mario