Click here to Skip to main content
15,893,401 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Iam using Subgurim's StaticGMap control. I have defined 3 static points on the map using Subgurim's StaticPath() method. I use below params on static path variable.

path.colorNet = Color.Black;<br />
        path.weight = 3;<br />
        path.alpha = 150;



The map displays fine without issues. However when the same method is called multiple times (when the page reloads on submit of a button),the path weight increases by itself and after that I lose the map image instead only a message - "Google maps control for ASP.NET by Subgurim. http://googlemaps.subgurim.net " is displayed on page. Has anyone come across this issue? I attempted to clear the points/dispose off the static map control before calling the method but there is no code to do this through subgurim.

Full code is below -

private void plotPoints()
    {
        GLatLng latLng = new GLatLng(-38, 176);
        StaticGMap1.GCenter = latLng;
        StaticGMap1.GZoom = 6;
       
        path = new StaticPath();
        path.points.Clear();
        path.colorNet = Color.Black;
        path.weight = 3;
        path.alpha = 150;
        StaticGMarker.ColorEnum color = (StaticGMarker.ColorEnum)3;
        StaticGMarker.SizeEnum size = (StaticGMarker.SizeEnum)2;
        path.points.Add(new GLatLng(-41.360319, 174.781494));
        path.points.Add(new GLatLng(-40.9301, 175.6714));
        path.points.Add(new GLatLng(-40.346544, 175.627441));
        StaticGMap1.addStaticPath(path);
    }

    protected void Page_Load(object sender, EventArgs e)
    {

        plotPoints();

    }


UPDATE from OP:
he below solution works.

Redirecting to the same page or a different page unloads the control.
Posted
Updated 2-Aug-10 20:23pm
v2

Did you consider asking the author ?
 
Share this answer
 
Subgurim has a forum accessible only by members who bought the commercial licence. Iam using their free publicly licenced control.

I am just looking for a way to refresh the control which i think will solve my problem. I have tried path.points.clear() which does not do the needful.
 
Share this answer
 
v2
Comments
Christian Graus 1-Aug-10 21:53pm    
The answer button is for answer. The comment button, which I used here, is for comments on existing posts. Odds are good that if there's no support for the free one, it's b/c they want you to buy it. Odds are low that anyone here has even used the control in question. And 'do the needful' is not English, you should stop saying it :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900