Hi
I have found an old post in JQCMap called "OnClick: Which marker is selected?"
I have tried to implement the solution without much luck. (I have converted the example to C++)
Every time I add the extra BrowserParams does the EventMouseOver not fire.
If I remove the BrowserParams does it fire correctly.
Can you tell me what I do wrong.
Here is my code:
//---------------------------------------------------------------------------
void __fastcall TIWForm2::IWCGJQGMap31JQGMapV3OptionsMarkerEventsMouseOver(TObject *Sender,
TStringList *AParams)
{
String MyMarkerId;
IWCGJQGMap3->JQGMapV3Options->InfoWindow->Options->ContentFunc->Script = IWCGJQGMap3->CurrEventParamsJs(2,'data');
IWCGJQGMap3->JQGMapV3Options->InfoWindow->Anchor->Script = IWCGJQGMap3->CurrEventParamsJs(0);
IWCGJQGMap3->JQGMapV3Options->InfoWindow->ApplyProps();
MyMarkerId = AParams->Values["markerid"];
// Do my stuff with MyMarkerId...
}
//---------------------------------------------------------------------------
void __fastcall TIWForm2::IWCGJQGMap31JQGMapV3OptionsMarkerEventsMouseOut(TObject *Sender,
TStringList *AParams)
{
IWCGJQGMap3->JQGMapV3Options->InfoWindow->Close();
}
//---------------------------------------------------------------------------
void __fastcall TIWForm2::IWButton1Click(TObject *Sender)
{
TIWCGJQGMap3MultipleMarker *LMarker;
TIWCGBrowserParam *BP;
IWCGJQGMap3->JQGMapV3Options->Map->Options->Zoom = 3;
IWCGJQGMap3->JQGMapV3Options->Map->Options->Center->Latitude = 40.36267630;
IWCGJQGMap3->JQGMapV3Options->Map->Options->Center->Longitude = -8.453534200000002;
IWCGJQGMap3->JQGMapV3Options->Map->Options->MapTypeControl = true;
IWCGJQGMap3->JQGMapV3Options->Map->Options->MapTypeControlOptions->Style = gmmtcsDropDownMenu;
IWCGJQGMap3->JQGMapV3Options->Marker-> Values->Clear();
// LISBON
LMarker = IWCGJQGMap3->JQGMapV3Options->Marker->Values->Add ();
LMarker->Data = "Lisbon, Portugal";
LMarker->LatLng->Latitude = 38.72529930;
LMarker->LatLng->Longitude = -9.150036400000001;
LMarker->Id = "mymarkerID_1";
BP = LMarker->Events->OnMouseOver->BrowserParams->Add();
BP->ServerName = "markerid";
BP->BrowserScript = "context.id";
// MADRID
LMarker = IWCGJQGMap3->JQGMapV3Options->Marker->Values->Add ();
LMarker->Data = "Madrid, Spain";
LMarker->LatLng->Latitude = 40.416775;
LMarker->LatLng->Longitude = -3.703790;
LMarker->Id = "mymarkerID_2";
BP = LMarker->Events->OnMouseOver->BrowserParams->Items-> Add();
BP->ServerName = "markerid";
BP->BrowserScript = "context.id";
}
//---------------------------------------------------------------------------