How to get particular touch Area?

前端 未结 3 702
北荒
北荒 2021-01-17 06:54

I am new to Iphone Development,

Given the following map. I want to raise a touch event whenever i select a particular part like \"Western Australia\". But that parti

3条回答
  •  梦毁少年i
    2021-01-17 07:17

    @Jim gives excellent advice on the general, portable algorithm. Since you're on iPhone, it may be convenient to convert your map information into UIBezierPath objects, however. See the Drawing and Printing Guide for details on how to create this kind of path object. You can then use [UIBezierPath containsPoint:] to do hit-testing for you. Having a path object also makes it convenient to do your highlighting if you want the same kind of effect as the webpage has.

提交回复
热议问题