This project is read-only.

Custom Markers Disappear on Reload

Apr 29, 2010 at 1:33 PM

I love this control but I'm trying to do fancier things and ran into a problem. This seems like a pretty simple thing but I'm stuck and can't find any prior mention of this issue. I'm having a problem when I use custom marker icons in my maps. Everything displays fine on the initial load but when the page is refreshed (as for example another control switches to Edit mode) the map remains but the markers disappear. The same map behaves exactly as expected if I use the default marker icons.  For the custom markers I believe I am setting the Url, Size, and Anchor properties correctly. I've tried it both in code-behind and embedded in the control to no avail.  Am I missing something?

May 10, 2010 at 10:10 PM
I had the same problem with the GoogleMap and a submit button nested into an UpdatePanel. I resolved the problem adding a PostBackTrigger to the UpdatePanel with ControlId setted to the submit button.
May 11, 2010 at 1:43 PM
I have this problem whether the map is in an UpdatePanel or not. I also did a test with the custom control page that is part of the demonstration pages ( I extracted the html markup to its own page (so I did not need the masterpage) and added a simple postback button and label that showed the time. As I expected, the custom markers disappeared on postback. So I know I'm not the only one with this problem with custom markers!
May 20, 2010 at 9:57 PM

I have the same problem. I found out that the custom marker icon size becoming (0,0) after the page is postback, please see part of the rendered page source code:

GoogleMap1.addMarker({"Address":null,"AutoPan":true,"Bouncy":false,"Clickable":true,"Draggable":false,"DragCrossMove":false,"IconAnchor":{"X":0,"Y":0},"IconSize":{"Height":0,"Width":0},"IconUrl":"/Images/Markers/icon16.png","InfoWindowAnchor":{"X":0,"Y":0},"Latitude":36.1605453491211,"Longitude":-115.160026550293,"MaxZoom":null,"MinZoom":null,"OpenInfoBehaviour":0,"ShadowSize":{"Height":0,"Width":0},"ShadowUrl":null,"Text":null,"Title":"RoadwayID:113, SegmentID:2, DeviceID:45"});

 When the first time page is loaded, the iconsize is (16,16). I am guessing the markers disappear just because the size is 0.

Any suggestions to solve this problem? Thanks!

May 21, 2010 at 6:52 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
May 21, 2010 at 6:56 AM


The problem will be fixed in next release 4.5