[LeafletJS - Reactive] access to marker image is 404

Forge Component
(5)
Published on 22 Jun by Vincent Koning
5 votes
Published on 22 Jun by Vincent Koning

Hello,

I am using LeafletJS - Reactive Version 1.2.1 in my Reactive Web App module.

I set up Markers property of the Leaflet block in this module. However, when I access the screen on my browser, there were two 404 HTTP status for 

  • /LeafletMobilePlugin/img/LeafletMobilePlugin.markershadow.png
  • /LeafletMobilePlugin/img/LeafletMobilePlugin.markericon2x.png

and no marker was shown on the map.

Are these the right path for the image files?

 (I found markershadow.png and markericon2x.png in the images folder of the module, but they have Runtime Path like /LeafletJS/img/LeafletJS.markerxxx.png)

Regards,

Junji Watanabe

Ai, that is one of the problems of maintaining several versions of the same component having them installed at the same time. I didn't spot this one. I'll get a fix out quickly (but probably not today). 

I just checked the solution and found the issue but found an underlying issue. I need to investigate this further before I can deploy a new solution. It seems that Images in a Library are not being deployed to the website and therefore can't be opened.


A quick solution for your problem. Install the Reactive Mobile application onto your environment. You don't need to do anything with it, just have it there. When this issue is solved you can remove it again.

Solution

Junji,

I just uploaded a new version that solves the issue. 

Perhaps nice to know; Images that are used in library modules are deployed in the consuming espace. This issue also prompted me to create an AddIcon function that I will implement in a future version.

Solution

Vincent,

I updated to the latest 1.2.2 and a marker was shown on my map.

Thank you.

> Perhaps nice to know; Images that are used in library modules are deployed in the consuming espace. This issue also prompted me to create an AddIcon function that I will implement in a future version.

That's good to know. 

In my case, until I added the reference to the images in the LeafletJS module and put them on my screen using Image widgets, images weren't uploaded to the server.

Regards,

Junji Watanabe

Hi,

I don't know if this is happening with somebody else but I'm still getting 404 for the following images, even in the Demo:

  • Logo
  • markericon2x (most important one)
  • markershadow
  • Preview

The most important one, marker icon 2x, makes the application behaves the same way OP described, no marker shown on the map.

They are correctly referenced in the application:




Workaround:

  • Import the image as resource
  • Set the Deploy Action to Deploy to Target Directory
  • Set Targe Directory to img
  • Rename the resource to the name it has in the Runtime Path dependency

Example markericon2x:

This way the image will be published to the app at the right directory and the icon will be displayed in the map on devices that use the retina icon.


Can you check this, Vincent Koning?


Cheers,

Leandro Oliveira

Hi Leandro,

I tried this and even this will not solve the issue. I have already made a support ticket about this and the problem lies in the fact that I use a Library instead of an Web Application. The ticket is still open since OutSystems is currently investigating if this issue is a bug or as indented. I'll await the outcome before making any changes to the component. You can however create a custom icon with the resources supplied and use that one for you markers.

Kind regards,

Vincent

Hi Leandro,

I do have an response of OutSystems support that I want to share with you. There is a workaround available but you need to create that yourself in your consuming application. I have tested this in the Demo application (that I will update today with this "fix"). 

Hope it helps.

Kind regards,

Vincent

Hi Vincent,

Thanks for your answers and sharing the workaround from Outsystems support. I already used the workaround that I posted and it works fine. What is curious about this behavior is that only some images are not being published correctly. I posted here to confirm if this was happening only with me.

Kind regards,

Leandro Oliveira

Hi Leandro,

What is even more curious is that what images are actually being deployed differs per environment. This is surely a bug but getting it to the direct department within OutSystems support is a task in itself :(.

Greetings,

Vincent