1
votes

I am using HCP portal service to provide fiori launchpad, but I could not find my controller and view file in Chrome Network Tab.

And I also find that my image location is not working in Cloud.

I tried these two :

                 var normalBusIcon = {
                      url: '../images/1bus_normal.png',
                      origin: new google.maps.Point(0,0), 
                      anchor: new google.maps.Point(0, 0)
                  };
                  
                  var normalBusHoverIcon = {
                      url: '/webapp/images/1bus_alert.png',
                  };

The error is

GET https://flpportal-iXXXXXXtrial.dispatcher.hanatrial.ondemand.com/images/1bus_normal.png 404 (Not Found)

https://flpportal-iXXXXXXtrial.dispatcher.hanatrial.ondemand.com/webapp/images/1bus_alert.png 404 (Not Found)

File hiberarchy is

Projectname

|--webapp

--|--controller

--|--images

I want to know how portal service change the file location , how to use namespace in image url. Thanks.

1

1 Answers

1
votes

If you are referring to images in your application, you should always use the getModulePath to assemble the URL. This would make sure your application not only works stand-alone, but also from a portal such as the portal service of the Fiori launchpad:

var normalBusIcon = {
    url: jQuery.sap.getModulePath("your.component.namespace") +
         "/images/1bus_normal.png",
    origin: new google.maps.Point(0,0), 
    anchor: new google.maps.Point(0, 0)
};