Howard,
I’m using web edition 3.0.0.0 ver.
Thanks
Hiren
Howard,
I’m using web edition 3.0.0.0 ver.
Thanks
Hiren
Hiren,
Sorry for I didn't say the version clearly. 3.0.0.0 is Assembly version which is not what I needed. Please check the file version for me. Or the following code helps you find what the version you are using.string version = Map.Version;
Hope it helps.
Thanks,
Howard
Howard,
It shows "MapSuiteCore:3.1.16;WebEdition:3.1.16"
Hiren
Hiren,
Could upgrade the web edition to the latest version which you can download in our web site. Or provide me a quick project which I can use for debugging?
Also, paste the callstack of the JavaScript exception if possible.
Thanks,
Howard
Howard,
Please find attached tooltip solution.
Kindly include WebEdition & MapSuiteCore reference to solution.
In this solution, as per your suggestion
1. I’m trying to create & register java script on server side.
2. Also I tried to use following on client side.
var beginToolTipsRequest = function() {
var lonlat = this.map.getLonLatFromViewPortPx(this.xy);
var args = lonlat.lon + ',' + lonlat.lat + ',' + vScale;
var context = $get('divTooltips');
WebForm_DoCallback('__Page',args,showToolTips,context,null,false);
};
None of above worked. It did not even fired ‘RaiseCallbackEvent’ event
Thanks
Hiren
977-ToolTip1.zip (9.56 KB)
Hiren,
I don't have the data in your code, but when I replaced into our own data, it works fine. The callback is raised correctly. I recommend upgrading your current version to the latest one. You have missed our two public release; in another word, you missed many fixed bugs.
Here is a screenshot of your sample project which runs to the break point I set in the callback.
If you have any questions please let me know.
Thanks,
Howard
Howard,
I’m scared to upgrade new version as I have alpha release next week.
I am not sure but upgrade to new version may stop working with functionality/module or may require code change. If that is case, can I download old version again?
Thanks
Hiren
Howard,
I don’t mind to send you data file, but its 10 MB size after zipping it.
Do you have any specific upload space or email id where I can send this file?
Thanks
Hiren
Hiren,
I think there is not the big of the deal to upgrade to our latest version. You can do it safely follow this steps.
1. Backup the old DLL you are reference currently. It’s under “[Installed Folder]\ThinkGeo\Map Suite Web Evaluation Edition 3.0\Developer Reference”
2. Download our latest DLL package and replace the old one.
3. Copy the files in system32 folder to “C:\WINDOWS\system32”.
4. Rebuild your solution.
5. Clear the IE cache and your server cache if it’s on.
6. Delete the JavaScript I mentioned above which is used for fixing a bug in 3.1.16.
7. Run your application.
It won’t take much time on configuration and testing.
If it won’t work please let me know.
Thanks,
Howard
Howard,
Thanks for quick response.
I will try with new version. Let you know if there is any issue.
Hiren
Hiren,
Please feel free to let me know if you encounter any issue.
Thanks,
Howard
Hi Howard,
I have very strange situation working with Tool Tip. On mouse hover at any scale level (VE scale 1-19) tool tip is displayed. When I select Highlight feature button to select an area on map at scale level 4, then hover on selected features tool tip works fine, even at street level it does. (See attached Tooltip-level-4.GIF & Tooltip-level-18.GIF)
Below are 2 scenarios that has problem displaying tool tip.
1.
When I highlight feature at lower level (not sure but roughly after zoom level 10), and then mouse hover tool top does not displayed. (See attached “tooltip-level-18-after highlight layer.GIF”)
2.
Same thing happens when I click on Search address where it zooms to selected address, then mouse hover does not display tool tip. (See attached “tooltip-level-18-after searching address.GIF”
I checked code at run time, it invokes call back event on mouse hover but doesn’t return any attributes count for above 2 scenarios.
Please find attached screen shot and code for reference.
Thanks
Hiren
1056-ToolTip.zip (245 KB)
Hi Hiren,
Thanks for your code. We don’t have the environment for debugging; so I cannot find the exact problem for you here. But please try to watch the return value of the callback. I’m not quite sure that you mean there is no value returns from the querying. If there is no misunderstanding, there must be some problem on the server side. Please confirm with me.
Thanks,
Howard
Hi Howard,
Tool tip code works absolutely fine as I mentioned earlier at any scale level (VE scale 1-19).
It gets stop working when ever I highlight features or search address.
It does display again only when I refresh page. (Page load)
Here is detail scenario…
On every mouse hover action, it fires ‘ICallbackEventHandler’ and invokes “RaiseCallbackEvent” function to display ToolTip. So far everything works fine.
When,
I perform highlight feature on the map or do address search followed by mouse hover action that fires ‘ICallbackEventHandler’ invoking “RaiseCallbackEvent” tool tip doesn’t display because query tool returns no values.
Its same code, same hover action on same object/line on map which used to display tool tip before highlight feature action but not it doesn’t.
Thanks
Hiren
Hiren,
The callback event raise means there is no problem on the client side. The query tools doesn't return features means there is some issues in the query. I guess the core issue is from this code below which I guess the distance is too small.double worldDistance = ExtentHelper.GetWorldDistanceBetweenTwoScreenPoints(Map1.CurrentExtent, clickScreenPoint, clickNextScreenPoint, 850, 725, GeographyUnit.Meter, DistanceUnit.Meter);
MultipolygonShape clickArea = clickWorldPosition.Buffer(worldDistance, GeographyUnit.Meter, DistanceUnit.Meter);
Could you try to use GetFeaturesNearestTo method of QueryTools instead to see if there is some features return to debug.
Any questions please let me know.
Thanks,
Howard
Howard,
I think that’s not the case, other wise it should not have worked even 1st time. Query tool gets count for hover feature on the map before any post back action.
It gets stop working only after I highlight some feature on map or do address search, in short I think it gets stop working after any post back action.
Any other suggestion?
I will try to use GetFeaturesNearestTo method. I think I did tried this method earlier with no results.
I will let you know.
Thanks
Hiren
Hiren,
The purpose to Use GetFeaturesNearestTo method is only to see if there is any feature in your query layer. On the other hand, we can focus on only the query without callback. So remove the callback logic then add a new InMemoryLayer to hold the buffered click point. Draw it after post back to see if there is any features intersected by eyes.
Hope it helps.
Any questions please let me know.
Thanks,
Howard
Howard,
I found the root cause for while debugging.
ScreenPointF clickScreenPoint = Map1.ToScreenCoordinate(clickWorldPosition);
Returns clickScreenPoint that has X & Y value
Let’s say,
Before any post back action X & Y has following values that displays tool top correctly on hover action on point A Then I’m adding 0.0009 to X to get new screen point X1 value, Y & Y1 is same
X = 51.80943, X1 = 51.81033
Y = 499.7222 Y1 = 499.7222
After any post back action, X & Y values does not return same or even closet value to above values. I got following X & Y values on mouse hover action on point A. Adding 0.0009 to X to get new screen point X1 value, Y & Y1 is same
X = 57.56257, X1 = 57.56347
Y = 475.5, Y1= 475.5
Below is code for your reference.
public void RaiseCallbackEvent(string eventArgument)
{
string[] lonlatStrings = eventArgument.Split(',');
string[] iCurrScale = eventArgument.Split(',');
int iCurScale = Convert.ToInt32(iCurrScale[2]);
System.Text.StringBuilder sb = new System.Text.StringBuilder();
// get the click position.
PointShape clickWorldPosition = new PointShape(double.Parse(lonlatStrings[0]), double.Parse(lonlatStrings[1]));
// convert to screen point.
ScreenPointF clickScreenPoint = Map1.ToScreenCoordinate(clickWorldPosition);
//clickScreenPoint = new ScreenPointF(Convert.ToSingle(51.80943), Convert.ToSingle(499.7222));
// 5 is the radius to buffer the click point.
double nextSPX = 0;
if (iCurScale == GetToolTipScale.sr4_no) // 4 to 12
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr4_radiusfactor; } // 5;
else if (iCurScale == GetToolTipScale.sr5_no) // 13 to 15
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr5_radiusfactor; } // 0.09;
else if (iCurScale == GetToolTipScale.sr6_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr6_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr7_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr7_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr8_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr8_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr9_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr9_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr10_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr10_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr11_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr11_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr12_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr12_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr13_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr13_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr14_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr14_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr15_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr15_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr16_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr16_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr17_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr17_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr18_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr18_radiusfactor; } // 0.0009;
else if (iCurScale == GetToolTipScale.sr19_no) // 16 to 19
{ nextSPX = clickScreenPoint.X + GetToolTipScale.sr19_radiusfactor; } // 0.0009;
ScreenPointF clickNextScreenPoint = new ScreenPointF(Convert.ToSingle(nextSPX), clickScreenPoint.Y);
// calculate the distance is world coordinate of the radius.
double worldDistance = ExtentHelper.GetWorldDistanceBetweenTwoScreenPoints(Map1.CurrentExtent, clickScreenPoint, clickNextScreenPoint, 850, 725, GeographyUnit.Meter, DistanceUnit.Meter);
// calculate the buffer which you need.
MultipolygonShape clickArea = clickWorldPosition.Buffer(worldDistance, GeographyUnit.Meter, DistanceUnit.Meter);
//Get current zoom scale
iCurrentScale = iCurScale;
Collection<Feature> TTFeatures;
string sTTColname = string.Empty;
#region Access Point
if (iCurrentScale >= LayersScale.Access_Points_scaleupper && iCurrentScale <= LayersScale.Access_Points_scalelower) //Lower is high value
{
if (LayersScale.Access_Points_status == 1 && LayersScale.Access_Points_tooltip_Status == 1)
{
sl.lyr_point_Access_Point = (ShapeFileFeatureLayer)((LayerOverlay)Map1.CustomOverlays[0]).Layers["Lyr_Access_Point"];
sl.lyr_point_Access_Point.Open();
TTFeatures = sl.lyr_point_Access_Point.QueryTools.GetFeaturesIntersecting(clickArea, ReturningColumnsType.AllColumns);
sl.lyr_point_Access_Point.Close();
if (TTFeatures.Count > 0)
{
dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'point' and id = 5 and lid = 1"; //Access Point
if (dsAppConfig.Tables[1].DefaultView.Count > 0)
{
sTTColname = dsAppConfig.Tables[1].DefaultView[0]["hovercolumndisplay"].ToString();
for (int i = 0; i < TTFeatures.Count; i++)
{
sb.AppendLine(TTFeatures.ColumnValues[sTTColname]);
}
}
}
}
}
#endregion
#region Span
if (iCurrentScale >= LayersScale.Span_scaleupper && iCurrentScale <= LayersScale.Span_scalelower) //Lower is high value
{
if (LayersScale.Span_status == 1 && LayersScale.Span_tooltip_Status == 1)
{
sl.lyr_line_Span = (ShapeFileFeatureLayer)((LayerOverlay)Map1.CustomOverlays[0]).Layers["Lyr_Span"];
sl.lyr_line_Span.Open();
TTFeatures = sl.lyr_line_Span.QueryTools.GetFeaturesIntersecting(clickArea, ReturningColumnsType.AllColumns);
sl.lyr_line_Span.Close();
if (TTFeatures.Count > 0)
{
dsAppConfig.Tables[1].DefaultView.RowFilter = "type = 'line' and id = 6 and lid = 1"; //Span
if (dsAppConfig.Tables[1].DefaultView.Count > 0)
{
sTTColname = dsAppConfig.Tables[1].DefaultView[0]["hovercolumndisplay"].ToString();
for (int i = 0; i < TTFeatures.Count; i++)
{
sb.AppendLine(TTFeatures.ColumnValues[sTTColname]);
}
}
}
}
}
#endregion
callbackResult = sb.ToString();
}
Thanks
Hiren
Howard,
I also tried GetFeaturesNearestTo which returns querytool count before post back action but it does not return any query tool count after post back action.
Thanks
Hiren
Hiren,
I figure out the issue is from the current extent. We are using callback which causes the current extent is not synchronized to the server. We need to synchronize it by callback parameters.
I made a sample for you with austin street data and it works fine. Please have a try.
Any questions please let me know.
Thanks,
Howard
1084-Post5996.zip (8.18 KB)