HTML5 Injection - Google Maps

HTML5 Injection - Google Maps

  

Hi,

I'm trying to inject HTML5 in a expression in way to have google maps in my APP.

If I put the HTML in a notepad i get the maps, but when I passed to an expression it didn't work.

I let the code at the attachment, remember that file does not have the API key.

Anyone knows what is the problem?

Hi Henrique.

Why are you injecting google mas directly, instead of using the forge component?
Also, in the expression, are you setting Escape Content to NO? (Otherwise, the browser will not understand this as HTML, but as simple text.

Cheers.

Hi Eduardo, 

Im trying to Inject directly because I want to try to do some formatations.

Yes, i had put NO in Escape Content.


Hi Henrique,

The component is quite flexible, can you explain what you're trying to format?

Do you have any js errors on the browser console?

Cheers,

Hi Henrique,

Yes I got some error on the console:



Hello Henrique Leite,

The error says that the JavaScript is trying to do something inside an element, but the element was not found.
Ususally there are two reasons for this.

1. You are passing a wrong ID and the selector in the JavaScript do not find the element it needs.
2. You are executing the JavaScript BEFORE the element is rendered by the browser (most common cause).

As I think you are passing an ID for the JavaScript, try to put the expression AFFTER the element you are trying to use together the JavaScript.

Cheers.

EDIT:

By the way, I notice your expression starts with the tag <html>. I think this will cause a LOT of problems, as the page where the expression is being put is built automatically by the server and already has the <html> tag...

And the script that you're trying to execute?

Can you send a sample .oml? Or at least explain what are you trying to achieve?

Cheers,

Yes ofc, that is my sample where im testing out.


Here Im forcing points right now:


 Forcing starting point and end point

displayRoute('Ikea Torino,Itália', 'Braga,Portugal', directionsService,


Intermediate points

  waypoints: [{location: 'Savona,Itália'},{location: 'Braga,Portugal'},{location: 'Barcelona,Espanha'},{location: 'Terminal Constanti,Espanha'},{location: 'Terminal Alfarelos,Portugal'},],



Henrique Batista wrote:

And the script that you're trying to execute?

Can you send a sample .oml? Or at least explain what are you trying to achieve?

Cheers,

Any result?


Solution

Hello Henrique.

Your code has some very big problems...

I'll start asking what is your experience with OutSystems, HTML and JavaScript, because your coudl would never work...

I'll recommend you to do the OutSystems online trainings (if you didn't) or a live one, and avoid trying to use JavaScript if you are not really secure about how to proper use it or how to proper use it with OutSystems.

In any case, here goes a (very bad) module with some changes to put it roughly to work.

Cheers.

EDIT:

P.S. Can take some time to someone to return with an answer, so, wait a day or two before asking for results is a good practice.

Solution

Hi Eduardo,

I'm sorry for the intervention, anyways, my experience is very low, in every platform, i have been programming lightly for about 5/6 months. The objective was, In a query, I got all of the loading, and unloading, places from my data and then I insert that informatio in maps code, the result is the complete route from the shipment.

I attach an print from the platform.

Thanks for the help, gonna look for Outsystems starting guides.


Well...

Doing is also learning :)

Good studying!