Hi
I'm testing several test to find a way to solve an issue without positive result
I'm trying to include TMSFNCGooglemaps inside a DIV defined inside an HTML Template.
Each test result with 2 problems
during first webform render, the Maps is displayed with wrong size
after a page resize, the maps adopt the right size but the relative position inside div is wrong with value for top and left (in place for 0)
unfortunately, if the test project for support request was working fine, it isn't the case for the project I'm working on
In this one the top, left of the for TMSFNCGoogleMaps are populated with values
After some test it seems I found a solution (but may be not the best)
I use the event OnAfterDraw for TMSFNCGoogleMaps then I set value I wish to find in the for this component
(here TFormView_Carto_TMSFNCGoogleMaps1 is the name inside JS, concat of WebForm Name +"_"+ what seems to be a default TMSFNCGoogleMaps component name, it isn't not the name of component in IDE)
procedure TFormView_Carto.POIMapAfterDraw(Sender: TObject;
AGraphics: TTMSFNCGraphics; ARect: TRectF);
begin
asm
var mapElement=document.getElementById("TFormView_Carto_TMSFNCGoogleMaps1");
mapElement.style.setProperty("top",0);
mapElement.style.setProperty("left",0);
mapElement.style.setProperty("position","relative");
end;
end;
I improved the process to find inside document the FNC Google Map component by scanning the id (based on form+component names) as it can change of number