ThinkGeo.com    |     Documentation    |     Premium Support

Loading Image is not viewing

I am using mapsuite mvc edition and there is problem in loading image. It is not showing my code is given below
Map1.MapTools.LoadingImage.ImageUri = new Uri(Server.MapPath(@"~/ShapeFiles/loading_logofinal_by_zegerdon-d60eb1v.gif"));

Browser show an error
Not allowed to load local resource:
If there is error in my code please tell me how to resolve it.
Thank you.

Hi Hamza,

It seems that the issue is caused by the ImageUri. It is a HTTP URI, not file path.

Please see the following code:

map.MapTools.LoadingImage.ImageUri = new Uri(new Uri(Request.Url.AbsoluteUri), "../../Content/Images/loading.gif");
map.MapTools.LoadingImage.Width = 64;
map.MapTools.LoadingImage.Height = 64;
map.MapTools.LoadingImage.Enabled = true;

Hope it can help you.
Thanks,
Emil

Hi Emil,
I want to show Loading gif of Map through javascript.
If there is any syntax to do that please tell me.
Thank you.

Hi Hamza,

Let me summarize what I believe is the problem to make sure I understand:
The loading gif is already display properly when the map is loading, then you want to control it manually through JavaScript.

There is no JavaScript API to control it manually, it is designed to automatically display.

The solution:
I think we can change the element status to do that, such as element style. As shown below:

var loadingImageElement=document.getElementById("loadingcMap1");
loadingImageElement.style.display="block";
// or
loadingImageElement.style.display="none";

If something misunderstood, please provide more information.

Thanks,
Emil