Android Question B4XMap library event ShapesClicked

AlpVir

Well-Known Member
Licensed User
Longtime User
With the line :
B4X:
shapes.Add(coMapUtilities.instanceShapeImage(fcvMap,coMapUtilities.initShapeImage(coMapUtilities.initLatLng(Lt,Lg),xui.LoadBitmapResize(File.DirAssets,"photo.png",36dip,48dip,True),0,"PHOTO" & N )))
I superimpose some small images on the map created with the B4XMap library.
How to recognize which image is clicked? No. 1 or No. 2 or No. 3, .... ?
Surely you have to make the event :
B4X:
private Sub fcvmap_ShapesClicked(aLatLng As TMapLatLng,aList As List
but how ?
Thanks in advance
 

RB Smissaert

Well-Known Member
Licensed User
Longtime User
With the line :
B4X:
shapes.Add(coMapUtilities.instanceShapeImage(fcvMap,coMapUtilities.initShapeImage(coMapUtilities.initLatLng(Lt,Lg),xui.LoadBitmapResize(File.DirAssets,"photo.png",36dip,48dip,True),0,"PHOTO" & N )))
I superimpose some small images on the map created with the B4XMap library.
How to recognize which image is clicked? No. 1 or No. 2 or No. 3, .... ?
Surely you have to make the event :
B4X:
private Sub fcvmap_ShapesClicked(aLatLng As TMapLatLng,aList As List
but how ?
Thanks in advance
You can know what shape is clicked from the passed arguments, so in your case the TMapLatLng type and/or the aList list. I changed the list to a map (B4A map) as it gives
a bit more power/options. I also added the option to get multiple shapes on a click event as you can have a shape within a shape. This is all in the classed I passed to you.

RBS
 
Upvote 0
Top