Show PopUp

Hi,
FNC Maps, OpenLayers or Google Maps

i want to have a photo with 1 line of text

First i tried marker with the photo, but user has to click to get the text. I want the text to be always shown.

Then i tried popup with the following code but does not produce any popup

TMSFNCMaps1.BeginUpdate;
TMSFNCMaps1.ShowPopup(FormMain.Params[Temp_Station_Counter].Latitude,
FormMain.Params[Temp_Station_Counter].Longitude,
IntToStr(ORAQuery1.Fields[0].AsLongWord)+Channel_Units[Temp_Channel]+' '+Params[Temp_Station_Counter].Name,0,0);
TMSFNCMaps1.EndUpdate;

the same code with AddMarker instead of ShowPopUp with the same parameters displays the marker

Am i doing something wrong ?

Minas

Did you try without BeginUpdate & EndUpdate?

i did it, same behaviour !

// TMSFNCMaps1.BeginUpdate;
{TMSFNCMaps1.AddMarker(FormMain.Params[Temp_Station_Counter].Latitude,
FormMain.Params[Temp_Station_Counter].Longitude,
IntToStr(ORAQuery1.Fields[0].AsLongWord)+Channel_Units[Temp_Channel]+' '+Params[Temp_Station_Counter].Name,
'http://www.environ.gr/analyzer.jpg');
}
TMSFNCMaps1.ShowPopup(FormMain.Params[Temp_Station_Counter].Latitude,
FormMain.Params[Temp_Station_Counter].Longitude,
IntToStr(ORAQuery1.Fields[0].AsLongWord)+Channel_Units[Temp_Channel]+' '+Params[Temp_Station_Counter].Name,0,0);
// TMSFNCMaps1.EndUpdate;

Hi,

Assuming your code is inside the Form's OnCreate event, can you please make sure to the use the TMSFNCMaps OnMapInitialized event instead?

This sample code shows a popup after the map is loaded:

procedure TForm1.TMSFNCMaps1MapInitialized(Sender: TObject);
begin
  TMSFNCMaps1.BeginUpdate;
  TMSFNCMaps1.ShowPopup(TMSFNCMaps1.Options.DefaultLatitude,
  TMSFNCMaps1.Options.DefaultLongitude,
  'Popup Text',0,0);
  TMSFNCMaps1.EndUpdate;
end;

Hi,

is there a way to show a marker and its title without a click on the marker ?

popups works only throw TForm1.TMSFNCMaps1MapInitialized ?
If the map is already initialized is there any other way to show popups ?

Thank you,

Minas

  • At this time only the MapBox and MapKit service offer the possibility to display the title with the marker.
    Unfortunately this is currently not supported in the other available mapping services.

  • Once the map has been initialized you should be able to show a popup from anywhere in your code just like when showing a marker.

As long as i try outside of MapInitialized it does not work
I think that i can not show a popup from somewhere in my code just like when showing a marker.
It works only inside MapInitialized

Showing a popup from a button click event is working as expected when tested here for both Google Maps and OpenLayers. (after the map has been fully initialized)
If the problem persists, please provide a ready to run sample project that demonstrates the issue so I can further investigate this.

procedure TForm1.Button1Click(Sender: TObject);
begin
  TMSFNCMaps1.BeginUpdate;
  TMSFNCMaps1.ShowPopup(TMSFNCMaps1.Options.DefaultLatitude,
  TMSFNCMaps1.Options.DefaultLongitude,
  'Popup Text',0,0);
  TMSFNCMaps1.EndUpdate;
end;