Flutter Image Map 透過允許使用者在影像上定義可點擊區域並自訂顏色,實現互動式影像映射。受到 HTML 影像地圖的啟發,支援跨多個平台的觸控與點擊互動。開發者可輕鬆建立響應式、視覺吸引人的地圖,適用於導航、產品熱點或教育工具等應用。此套件可無縫整合至 Flutter 專案中,並提供簡單的 API 來定義區域及處理使用者輸入。
適用情境
互動式產品圖片
教育圖表
基於地圖的導航
熱點教程
使用者介面疊加層
主要特色
可自定顏色的區域
觸控與點擊事件處理
跨平台支援
簡單區域定義 API
響應式設計整合
適合對象
尋求互動式圖像的UI設計師
教育類應用開發者
電子商務產品展示
Web 與行動應用程式開發者
互動式文件
使用建議
需要手動設定區域座標
僅限靜態圖像互動
不適用於動態或動畫地圖
效能可能會因複雜形狀而有所差異
無內建縮放或平移功能
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
flutter_image_map
A simple but (hopefully) useful package that implements the HTML image map standard.
What is an Image Map?
Originally introduced in HTML 3.2 as a replacement for server side imagemaps. Server side image maps were clunky requiring a round trip to the web server to determine where to go based on the coordinates clicked in the image. Thus client side image-maps were born!
An imagemap is a graphic image where a user can click on different parts of the image and be directed to different destinations. imagemaps are made by defining each of the hot areas in terms of their x and y coordinates (relative to the top left hand corner). With each set of coordinates, you specify a link that users will be directed to when they click within the area.
As an example, say you have a map of the World that you wish to act as an image map. Each country could have their hot areas defined on the map to take you to different pages.
Examples
Check out the Example project for a full example code of all the differents ways to define image map regions.
Tools
https://www.image-map.net/ makes it extremely easy to create free HTML based image maps.
There is also a ROI(Region of interest) selecting tool in this project! ROI select tool link: http://www.jiayizhang.me
Website down. Source code of the tool is in this repo (index.html in root folder). Just open it in browser should be fine.
How to use ROI selecting tool
Select an image
Click on the image to add vertices of ROIs
If you want to create a new ROI, click on "New Polygon"
When you are done, press "Export"
It will pop up a dialog
The format of the data is:
List<List>, each sub-list describes a polygon. To adjacent numbers represent a position.
e.g.
[
[x1,y1,x2,y2,x3,y3,...],//Polygon 1
[x1,y1,x2,y2,x3,y3,...],//Polygon 2
[x1,y1,x2,y2,x3,y3,...],//Polygon 3
]