How to load HTML content in string to display a map in "CustomResourceBrowser" or "SchemeRegistrationBrowser"
Posted: Fri Nov 03, 2023 3:13 pm
Hi everyone,
First of all, I must mention that I am new to the topic of development with Delphi.
To give some context, I'm trying to integrate google maps into a project using delphi. I'm trying to use one of the CEF4Delphi demos to load the HTML content of the map and the Javascript functionalities that I will use to display the map, place markers and draw the route.
Reviewing the CEF4Delphi demos, I found the one for "CustomResourceBrowser". The problem I found is that, when loading the map, a message was displayed indicating "google is not defined", despite using that code in a separate HTML file and being able to view it without problems.
I took the example "SchemeRegistrationBrowser" and loaded the html code in a string.
Registered the "https" scheme but the result is the same, the map is not displayed. Again, if I right click on the window, view the page code, copy it to a separate file and open it in a browser, the map does display.
In the debug.log file you see this message:
[1101/135806.843:INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token '<'", source: https://maps.googleapis.com/maps/api/js?key=[API_KEY]=myMap (1 ).
I need to upload in this way so that I am not dealing with the HTML file and it can be deleted or modified.
Beforehand thank you very much
First of all, I must mention that I am new to the topic of development with Delphi.
To give some context, I'm trying to integrate google maps into a project using delphi. I'm trying to use one of the CEF4Delphi demos to load the HTML content of the map and the Javascript functionalities that I will use to display the map, place markers and draw the route.
Reviewing the CEF4Delphi demos, I found the one for "CustomResourceBrowser". The problem I found is that, when loading the map, a message was displayed indicating "google is not defined", despite using that code in a separate HTML file and being able to view it without problems.
I took the example "SchemeRegistrationBrowser" and loaded the html code in a string.
Registered the "https" scheme but the result is the same, the map is not displayed. Again, if I right click on the window, view the page code, copy it to a separate file and open it in a browser, the map does display.
In the debug.log file you see this message:
[1101/135806.843:INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token '<'", source: https://maps.googleapis.com/maps/api/js?key=[API_KEY]=myMap (1 ).
I need to upload in this way so that I am not dealing with the HTML file and it can be deleted or modified.
Beforehand thank you very much