Jump to content

[SOLVED] URL Rewrite Success.... Almost (Live Map inair icon)


skyguyt

Recommended Posts

Completed the .htaccess/url rewrite actions tonight on my website but am running into an issue with making the icons re-appear on various pages. I did figure out the view pirep page fix by changing

 

var url = window.location.href.split("index.php")[0];

to 

var url = window.location.href.split("pireps")[0];

inside of the phpvms.js file but can not quite figure out how to fix the live map in air icons with the following code written in the acarsmap.js 

    const getHeadingIcon = (heading) => {
        if (!(heading in headingIcons)) {
            headingIcons[heading] = L.icon({
                iconUrl: url + "/lib/images/inair/" + heading + ".png",
                iconSize: [35, 35]
            });
        }

        return headingIcons[heading];
    };

 

Any help would be much appreciated! 

 

Version: 5.5.2 (Simpilot's)

php Version: 5.4

MySQL

 

Thank you!

 

Edited by skyguyt
Link to comment
Share on other sites

15 hours ago, Curshad said:

Nothing looks wrong from what i can see. Try a hard refresh Ctrl+f5 if nothing still shows up you need to go to the acars map template file and make sure your url links in those files are reflecting your new url maybe it's still using the old url link.

 

Thanks for pointing out actually looking at the acars map file instead of just the acars.js file. I fixed it by removing the url portion of the script;

 

iconUrl: url + "/lib/images/inair/" + heading + ".png",

to 

iconUrl: "/lib/images/inair/" + heading + ".png",

 

And it works great!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • skyguyt changed the title to [SOLVED] URL Rewrite Success.... Almost (Live Map inair icon)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...