AlpVir Well-Known Member Licensed User Longtime User Mar 6, 2023 #1 With the line : B4X: Copy 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: Copy private Sub fcvmap_ShapesClicked(aLatLng As TMapLatLng,aList As List but how ? Thanks in advance
With the line : B4X: Copy 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: Copy private Sub fcvmap_ShapesClicked(aLatLng As TMapLatLng,aList As List but how ? Thanks in advance
R RB Smissaert Well-Known Member Licensed User Longtime User Mar 7, 2023 #2 AlpVir said: With the line : B4X: Copy 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: Copy private Sub fcvmap_ShapesClicked(aLatLng As TMapLatLng,aList As List but how ? Thanks in advance Click to expand... 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
AlpVir said: With the line : B4X: Copy 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: Copy private Sub fcvmap_ShapesClicked(aLatLng As TMapLatLng,aList As List but how ? Thanks in advance Click to expand... 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