Clickable objects

Clickable objects 
Tags: General Topics

Oct 29 2006 at 5:13 PM
Hi,

is it possible to bring not only Bitmaps (like pie charts sample) to the map but even clickable objects like
an imagebutton or hyperlink?

br

jubi

Developer
Oct 30 2006 at 8:45 AM
SharpMap creates images, and an image is not clickable like that. You would have to supply your own code to make mouse-events in specific areas on the image.

May 6 2007 at 6:09 PM

SharpGIS wrote:
SharpMap creates images, and an image is not clickable like that. You would have to supply your own code to make mouse-events in specific areas on the image.

How do you make mouse events in specific areas on the image, I also read the other post where you can store the location(x,y) of a clicked point on the map to a database, can we compare the x,y data to a given place's x,y and then pop up a small window or hyperlink it to something

Coordinator
Jun 20 2007 at 8:06 AM
You can use the ImageToWorld and WorldToImage methods of the Map class to translate between data (x, y) coordinates and screen (x, y) coordinates. Once you have this, you can do anything you want.

You are also free to put controls in the MapImage (and improved MapBox) control, and locate them anywhere you want in that control, like normal Win32 controls.
 
`android:clickable="true"` 是Android开发中XML布局文件中用到的一个属性,它用于设置某个View(视图)是否可以接收用户的点击事件。当属性值设置为"true"时,该视图就能够响应点击事件,例如用户的触摸、点击操作等。 在Android中,视图的点击事件处理通常是通过设置一个实现了`View.OnClickListener`接口的监听器来完成的。当视图被设置为可点击后,系统会调用该监听器中的`onClick`方法,从而允许开发者在其中定义点击事件发生时的处理逻辑。 例如,以下是一个简单示例: ```xml <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="点击我" android:clickable="true" /> ``` 在上面的XML代码中,我们定义了一个按钮,并且通过`android:clickable="true"`属性使按钮具有了响应点击的能力。为了在代码中处理点击事件,需要在对应的Activity中找到该按钮,并为其设置监听器。 ```java public class MyActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); Button myButton = findViewById(R.id.myButton); myButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // 在这里处理点击事件,例如显示一个Toast消息 Toast.makeText(MyActivity.this, "按钮被点击了!", Toast.LENGTH_SHORT).show(); } }); } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值