In a project we use the WebGMaps control to display a map of the region
Using a timer we Change the map to different locations/regions.
When a new location is more then about 70 kilomters away from the home-marker the new markericon is not visible,the markertext is displayed correctly. The icon of the Home Markers is being displayed all the time.
Call the Launch procedure again will draw all the markericons at the correct positions. moving the map manually via the mouse will also show the marker.
At the moment we draw the marker when it is needed, an other approach could be drawing all the markers before the launch procedure and changing the visible status, but I'm not sure if that is the opposed way to use markers.
At the OnTimer event the following procedure is executed
AddressToLatLang.Address:=Country Place Street Number';
if(NextLocation) and ( AddressToLatLang.LaunchGeocoding=TGeoCodingResult.erOk) then
begin
try
Regio.NorthEast.Latitude:=Min(WebGMaps1.MapOptions.DefaultLatitude,AddressToLatLang.ResultLatitude);
Regio.SouthWest.Latitude:=Max(WebGMaps1.MapOptions.DefaultLatitude,AddressToLatLang.ResultLatitude);
Regio.NorthEast.Longitude:=Max(WebGMaps1.MapOptions.DefaultLongitude,AddressToLatLang.ResultLongitude);
Regio.SouthWest.Longitude:=Min(WebGMaps1.MapOptions.DefaultLongitude,AddressToLatLang.ResultLongitude);
NewMarker:=WebGMaps1.Markers.Add;
with NewMarker do
begin
MapLabel.Text:=MarkerTitle;
InitialDropAnimation:=False;
Visible:=True;
Flat:=False;
Icon:=StringReplace('File://' + SymbolPath + '\info.png', '', '/',[rfReplaceAll, rfIgnoreCase]);
Draggable:=False;
Name:='Marker'+GoogleTourID.ToString();
Title:=MarkerTitle;
Latitude:=AddressToLatLang.ResultLatitude;
Longitude:=AddressToLatLang.ResultLongitude;
end;
WebGMaps1.CreateMapMarker(NewMarker);
WebGMaps1.StartMarkerBounceAnimation(GoogleTourID);
WebGMaps1.MapZoomTo(Regio);
I'm not sure what you mean with:
When I start the loop the map is centered at a location in the middle of the Netherlands, zoom set to 10
At the first OnTimer I add a marker in Maastricht Limburg (240 KM away from home marker), after calling the procedure CreateMapMarker, call StartMarkerBounceAnimation and finally call procedure MapZoomTo(Region) Region is set based on the new location and the home location. The map is displayed as detailed as possible showing both markers. For this location (Maastricht Limburg) the markericon is not visible
The second On Timer is exactly the same but for an other location, this location is closed to the home location, the marker icon is visible
The third location is in the northern part of the Netherlands, (Den Helder) the map has to shift to another region and zoom out.
The complete control is done prorgrammatically, the application will run on a infoscreen.
It seems to me that when the map has to zoom out the marker icon is not displayed, when the map will zoom in the marker icon is displayed.
To test this I added the following line after creating the marker
WebGMaps1.MapOptions.ZoomMap:=WebGMaps1.MapOptions.ZoomMap-1;
With this addional "map-change" all the markericons are displayed
I also changed the -1 to +1 for the ZoomMap, then the icons are also displayed, setting the ZoomMap to the same value will not show the marker icon.
Hi,