in the marker events only the "DragEnd" event supports the Lat/Lng position in the browserparams.
I need this in "onclick" too.
1.)
I tried to add the Browserparams like:
- Code: Select all
GMap3.JQGMapV3Options.Marker.Events.OnClick.BrowserParams.Clear;
with GMap3.JQGMapV3Options.Marker.Events.OnClick.BrowserParams.Add do
begin
ServerName:= 'Getlatlng';
//BrowserScript:= 'event.latLng'; // onclick fired but the result is [undefiened]
//BrowserScript:= 'marker.getPosition().lng()'; // Not working
end;
GMap3.JQGMapV3Options.Marker.Events.OnClick.OnEvent:= MultiMarkerClickEvent;
But I didnt know the right "Browserscript"
2.)
I tried to add Javascript in the map component like this:
- Code: Select all
JS:= TIWCGJScript.Create;
try
Js.Text:=
'google.maps.event.addListener(marker, ''click'', function (event) {'+
' map.setCenter(event.latLng);'+
' map.setZoom(17);'+
'});';
GMap3.JQGMapV3Options.Marker.CGJSContainer.AddJavaScriptToAjaxResponse(js.Text);
//GMap3.JQGMapV3Options.Marker.CGJSContainer.Script:=JS.Text;
finally
JS.Free;
end;
Please bring me on the right way.