0

I have a Windows 2012 file server and need to reference a local file on the file server using a https:// formatted reference for a COTS function to load. It is a KML file and I am unable to load it. The error I am getting is "Failed to load network link". Here is the code I have been using but am unable to get it to work this far:

            var overlayProperties = {
            "name": "Operations",
            "url": "https://localhost/KML/Operations.kml",
            "type": MoW.protocols.KMLProtocol.TYPE.url
        };

    var newOverlayObject = MoW.Factory.createKMLOverlay(overlayProperties);


    map.addOverlay(newOverlayObject, {
        showAlert: true
    });
    }
holdorfs
  • 41
  • 7
  • Can you browse to *https://localhost/KML/Operations.kml* on the server – Jon P Jan 01 '20 at 22:08
  • No. I tried to browse to https://192.168.30.221/KML/Operations.kml and https://localhost/KML/Operations.kml and localhost/KML/Operations.kml and with localhost/KML/Operations.knl I get a 404 error not found – holdorfs Jan 01 '20 at 23:44
  • Well there's your problem. Is the server configured to serve .kml file type or the correct mime type? – Jon P Jan 02 '20 at 00:09
  • From what I'm reading this is done through IIS. What I'm using to run the application is Visual Studio IIS express. I'm not sure how I would do this when using VS IIS express. – holdorfs Jan 02 '20 at 06:00
  • https://stackoverflow.com/questions/9021946/add-mime-mapping-in-web-config-for-iis-express may get you moving in the right direction – Jon P Jan 02 '20 at 06:18
  • The following was added to the web.config and I am still getting the error – holdorfs Jan 02 '20 at 15:51
  • Can you browse to anything via https on local host? – Jon P Jan 02 '20 at 21:53
  • No. As a matter of fact I'm logged in as administrator and I moved the file under the \users\Administor directory and I am getting an error "Access Denied" when I try to open the file. – holdorfs Jan 03 '20 at 18:37

1 Answers1

0

I figured out what the problem is with getting the JavaScript library I am working with the APIs to read project resources (Icons, CSS and Script paths). In the code behind what needs to happen is calling the .NET function below:

ResolveUrl(“~/Images/Operation.png”)

holdorfs
  • 41
  • 7