function clearShapeFill(shapeToClear){
    if(shapeToClear.Primitives.length>0)    
        shapeToClear.SetFillColor(new VEColor(0,255,0,0));                            
    
}
                            
function locateMe(m)
{
    var zoom=map.GetZoomLevel();
    var centre=map.GetCenter();
    
        $.ajax(
        {
            type:"GET",
            url: "CurrentLocation.ashx",
            data:{
                WKT:'POINT(' + centre.Longitude + ' ' + centre.Latitude + ')'
               ,Zoom: zoom
            },
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(json)
            {
                if(json.Boundary)
                {
                   var activeBoundaryCode=json.Boundary;
                   for(var i=0;i<boundaryLayer.GetShapeCount();i++){
                        var s=boundaryLayer.GetShapeByIndex(i);
                        if(s.Boundary && s.Boundary.Code==activeBoundaryCode){
                            s.SetLineColor(new VEColor(255,0,0,1));
                            s.SetZIndex(100);
                            s.SetFillColor(new VEColor(0,255,0,0.3));
                            
                            setTimeout(function(){clearShapeFill(s)},3000);

                            if(s.Boundary.Force != currentBoundary.Force || s.Boundary.Code != currentBoundary.Code)
                            {
                                
                                currentBoundary=s.Boundary;
                                updateLocalDetails();
                                 var notice = '<div class="notice">' 
                                    + '<div class="notice-body">' 
                                        + '<img src="static/img/info.png" />' 
                                        + '<p>You are now viewing data for <strong>' + currentBoundary.BoundaryName + '</strong></p>' 
                                    + '</div>' 
                                    + '<div class="notice-bottom">' 
                                    + '</div>' 
                                + '</div>'; 
                                $( notice ).purr(); 
                                if(dotsDisplayed)
                                    notifyCurrentCrime();
                            }
                            
                            
                        }else{
                            s.SetLineColor(new VEColor(0,0,0,0.5));
                            s.SetZIndex(50);
                            s.SetFillColor(new VEColor(0,255,0,0));
                        }
                   }
                }
            }
           ,error: function(request,text,obj){
                
            }
        }
    );
}
