Update Map without refreshing?

Mar 27, 2008 at 9:47 PM
hi

anyway to update the map, without a postback or callback?
thanks
c
Coordinator
Mar 28, 2008 at 6:58 AM
Edited Mar 28, 2008 at 6:58 AM
Hi,

It could be possible.
As I have promoted in last releases I have extended the JS model and it can be used on the client-side.
Further more, if you do some changes in the client-side code, let's say for example you add a marker through the JS code, then if you later postback to server, that marker will be persisted to the server-side.
In some cases that could be very helpful and be used very advanced.
That's why I did extend the JS model.
It's a shame I have no time recently for making some really good samples about that (too busy :( - a lot of projects working on).

However, please, give me some short description of what you need to do and how you want to be working and I will try to produce a sample page durring this week-end.

Regards
Mar 28, 2008 at 1:35 PM
Edited Mar 28, 2008 at 1:37 PM
wow velio;

that would be great. i have played around with the google JS api, or was considering writing WebMethods that your API.

my need would be: i have 5 "friends" whose location is stored in the database, and updated automatically. i want to display their changes, on my map, automatically (every 30 seconds), without a panel refresh.

----
2) also, i am wondering how i can get the current zoom level from the map? so when i refresh it, it takes the current zoom.

right now i am using a timer and a panel.

thanks
cj
Coordinator
Mar 31, 2008 at 5:54 AM
Hi,
I have not forgot about the sample, just a busy wee-end :).
I'll do it tonight.

Regards
Mar 31, 2008 at 5:24 PM
thanks!
Coordinator
Mar 31, 2008 at 8:20 PM
Hi,

So, first because of the nature of UpdatePanel if you put a GoogleMap control inside it, the map will be reloaded every time a post back in the UpdatePanel is done. The UpdatePanel changes the inner HTML content after AJAX post back. Thus it changes the Google Map container element (DIV) and that's why it is reloaded again.
Second, I have found a problem while working on the sample (again caused by the nature of UpdatePanel).If there is UpdatePanel on the page and even, if GoogleMap control is not inside the UpdatePanel, it was reloaded on every AJAX post back.

I have fixed that and now GoogleMap control has a property InsideUpdatePanel which have to be set explicitly to true when GoogleMap control is inside UpdatePanel.
I will update the release files and Sample Website tomorrow morning.

However, the live Sample Website was updated and you can see the sample here .

I'm just generating random markers there and using UpdatePanel, but GoogleMap control is not inside it.
You can use with same result and if you prefer Page Methods as well.

Regards
Apr 1, 2008 at 1:02 AM
hi, thanks for the update.
i downloaded the latest release DLL, added the insideupdatepanel property, but get the following javascript error

"artem is undefined"

any ideas?
Coordinator
Apr 1, 2008 at 6:05 AM
Hi,
Please, send me, if possible, some details of the code you using the GoogleMap control to re-produce the problem.

Regards,
Apr 1, 2008 at 3:23 PM
hi velio

it works now (something wrong with my other pc, i guess).
i get a slight flicker, though....

i am in an ASCX in DNN.


<asp:UpdatePanel runat="server" ID="upTest">
<ContentTemplate>

<artem:GoogleMap ID="GoogleMap1" runat="server" Width="560px" Height="560px"
InsideUpdatePanel="true" EnableScrollWheelZoom="true" EnableDoubleClickZoom ="true" Zoom="12">
</artem:GoogleMap>


<asp:Timer ID="Timer1" runat="server" Interval="30000" OnTick="Timer1_Tick">
</asp:Timer>


</ContentTemplate>
</asp:UpdatePanel>
<asp:Label ID="Label1" runat="server" Text="not refreshed yet."></asp:Label>
<asp:Label ID="lblError" runat="server" CssClass="Error"></asp:Label>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<asp:LinkButton ID="lbHistory" runat="server" CssClass="Small" OnClick="lbHistory_Click">Show My History</asp:LinkButton>
<asp:LinkButton ID="lbDisableTimer" runat="server" CssClass="Small" OnClick="lbDisableTimer_Click">Disable the Timer</asp:LinkButton>

Apr 1, 2008 at 11:13 PM
maybe you can just post the example code, instead.
thanks!
Coordinator
Apr 2, 2008 at 5:51 AM
Edited Apr 2, 2008 at 5:54 AM
Hi
The you can see the working example here
And the entire code can be found in GoogleMap Control 3.2 Sample Website release file - page GoogleMapClientUpdate.aspx.

Regards