# Tooltip.cs script

**URL:** <https://mapwindow.discourse.group/t/tooltip-cs-script/623>\
**Category:** MapWinGIS\
**Created:** [June 17, 2020, 3:26am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623 "2020-06-17T03:26:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kayumiy](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/kayumiy/32/233_2.png) [@Kayumiy](https://mapwindow.discourse.group/u/Kayumiy)\
**Post date:** [June 17, 2020, 3:26am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/1 "2020-06-17T03:26:44Z")

</div>

I am testing ToolTip.cs

It does not show label when cursor over the layer.  
See the result please:

 ![image](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/e4550d111d014432783615b2a598cf870aee2f05.png)

This is the tutorial’s result:

 ![image](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/9432eed1ba102fd9088109741d85311dc83b2b62.png)

---

<div class="post-metadata">

**Author:** ![Kayumiy](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/kayumiy/32/233_2.png) [@Kayumiy](https://mapwindow.discourse.group/u/Kayumiy)\
**Post date:** [June 17, 2020, 4:57am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/2 "2020-06-17T04:57:20Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/c1f88cd7f9038b3ec09887c8eea93a63e8d1ca08.png)

This condition is always false

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [June 17, 2020, 5:16am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/3 "2020-06-17T05:16:42Z")

</div>

Hello @Kayumiy

Without knowing anything about the layer you are using (point vs polyline vs polygon) my first guess would be to try increasing the Tolerance. You are handing in a point to SelectShapes, with a tolerance of 0.0. So if it is a point or polyline shapefile, try setting the tolerance to perhaps 10 or 20.

---

<div class="post-metadata">

**Author:** ![Kayumiy](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/kayumiy/32/233_2.png) [@Kayumiy](https://mapwindow.discourse.group/u/Kayumiy)\
**Post date:** [June 17, 2020, 5:29am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/4 "2020-06-17T05:29:15Z")

</div>

![image](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/96b2a25b0ddec7718d4450e6f6966f948f779fae.png)

In the tutorial, landuse.shp is used when shapefile is loaded.  
I don’t have a landuse.shp, therefore, I am using my own shapefile.

How can I find landuse.shp in order to test properly?

---

<div class="post-metadata">

**Author:** ![jerryfaust](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/jerryfaust/32/378_2.png) [@jerryfaust](https://mapwindow.discourse.group/u/jerryfaust)\
**Post date:** [June 17, 2020, 5:47am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/5 "2020-06-17T05:47:07Z")

</div>

You don’t need to use landuse.shp. Yours is fine. I’m just saying that depending upon the type of shape, you may need a tolerance.

---

<div class="post-metadata">

**Author:** ![Kayumiy](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/kayumiy/32/233_2.png) [@Kayumiy](https://mapwindow.discourse.group/u/Kayumiy)\
**Post date:** [June 17, 2020, 6:20am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/6 "2020-06-17T06:20:24Z")

</div>

I have tested by setting tolerance to 10 or 20. No label in the map.

I don’t even know in what position the label will be displayed in the map.

 ![image](https://global.discourse-cdn.com/free1/uploads/mapwindow1/original/1X/2c321445309197a845627f4d89cc98b36ee06468.png)

---

<div class="post-metadata">

**Author:** ![Kayumiy](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/kayumiy/32/233_2.png) [@Kayumiy](https://mapwindow.discourse.group/u/Kayumiy)\
**Post date:** [June 17, 2020, 6:34am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/7 "2020-06-17T06:34:06Z")

</div>

How Do I know type of layer (polygon, point or polyline)?

---

<div class="post-metadata">

**Author:** ![ramkiponnam](https://avatars.discourse-cdn.com/v4/letter/r/6a8cbe/32.png) [@ramkiponnam](https://mapwindow.discourse.group/u/ramkiponnam)\
**Post date:** [June 17, 2020, 10:44am UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/8 "2020-06-17T10:44:19Z")

</div>

Hi Kayumiy

First convert the layer to shapefile using AxMap.get\_ShapeFile(int layerindex)  
Then get the Type by using shapefile.ShapefileType.

If the layer is OgrLayer then you can get the type using layer.ShapeType

Regards,  
Ramki

---

<div class="post-metadata">

**Author:** ![pmeems](https://yyz2.discourse-cdn.com/free1/user_avatar/mapwindow.discourse.group/pmeems/32/9_2.png) [@pmeems](https://mapwindow.discourse.group/u/pmeems)\
**Post date:** [January 5, 2022, 3:09pm UTC](https://mapwindow.discourse.group/t/tooltip-cs-script/623/9 "2022-01-05T15:09:05Z")

</div>


