Anonymous user  |  Log in  |  Create Account
Message inside General Discussions

Polygon clickable=false problem : Please help.

Answer 
#1 - 8/23/2010 3:46:36 PM Reporta abuso | PermaLink
ScottJHalls
Fecha de registro: 8/23/2010
3 posts en todos los foros
Polygon clickable=false problem : Please help.

Answer Quote
Hi,
Hope someone can help. I have a polygon that is used to denote a border. I wish to capture the Lat and Long for the point the user has clicked inside this border using Server Side events.

However, with the polygon created, the OnClick event for the map does not fire, only the OnPolygonClick. However with OnPolygonClick, e.point only returns the centre of the polygon, not the location the user clicked.

I have tried setting the Polygon property "clickable" to false, but then the polygon does not render at all. Is this a bug?

I want to capture the Lat and Long for the actual click, not the centre of the polygon, or turn off the click event for polygons. Is this possible?

Best regards and many thanks,
Scott Halls
Top

Answers
De en 15
#2 - 8/30/2010 5:05:34 PM Reporta abuso | PermaLink
subgurim
Fecha de registro: 10/18/2006
2003 posts en todos los foros
RE: Polygon clickable=false problem : Please help.

Answer Quote
Thanks for the solution!!

Regards.
Top

#3 - 8/24/2010 12:27:17 PM Reporta abuso | PermaLink
ScottJHalls
Fecha de registro: 8/23/2010
3 posts en todos los foros
RE: Polygon clickable=false problem : Please help.

Answer Quote
Hi,
I have managed to solve the problem.

It seems as though the javascript for the polygon is using "clickable:False" rather than "clickable: false".

I have go round this by adding custom javascript to the google maps, as shown below.

Dim Points As New List(Of Subgurim.Controles.GLatLng)
Dim objJS As New Text.StringBuilder

**** Add point here ******

Dim objPolygon As New Subgurim.Controles.GPolygon
objPolygon.points = Points
objPolygon.clickable = False
objPolygon.fillColor = "004444"
objPolygon.fillOpacity = 0.1
objPolygon.strokeColor = "001144"
objPolygon.strokeWeight = 2
objPolygon.close()


objJS.Append("function addborder()")
objJS.Append("{")
objJS.Append(objPolygon.ToString(vobjGMAP.GMap_Id))
objJS.Replace("clickable:False", "clickable: false")  ' Replace incorrect False statement
objJS.Append("}")

vobjGMAP.addCustomInsideJavascript("addborder();")
vobjGMAP.Add(objJS.ToString)


Top

#4 - 8/24/2010 10:40:00 AM Reporta abuso | PermaLink
ScottJHalls
Fecha de registro: 8/23/2010
3 posts en todos los foros
RE: Polygon clickable=false problem : Please help.

Answer Quote
I have tried this, but unfortunately this doesn't solve the problem

I have added the OnClick event as a Listener. However, the event OnClick does not fire when the polygon is added and I still can't see a way to capture the Lat and Long for the OnClick event with the polygon visible.

Regards,
Scott
Top

#5 - 8/23/2010 7:53:11 PM Reporta abuso | PermaLink
subgurim
Fecha de registro: 10/18/2006
2003 posts en todos los foros
RE: Polygon clickable=false problem : Please help.

Answer Quote
Hi Scott,

It seems a bug. I'll solve it on next release.

Until then you can use Custom Server Events.

Regards.
Top
De en 15

Powered by Subgurim.NET