Bạn có thể sử dụng Vị trí Overlay của tôi để hiển thị cả hai vị trí hiện tại của bạn và định hướng (đại diện là một điểm đánh dấu màu xanh nhấp nháy.)
Đoạn sau đây cho thấy làm thế nào để cho phép cả la bàn và đánh dấu.
Giới thiệu chia thành từng nhóm Lớp phủ và mục Overlay
Overlayitems được sử dụng để cung cấp các chức năng đánh dấu đơn giản lại bản đồ của bạn xem qua các lớp ItemizedOverlay.
itemizedOverlays cung cấp một phím tắt thuận tiện cho việc thêm dấu vào bản đồ, cho phép bạn chỉ định một hình ảnh đánh dấu và văn bản liên quan đến một vị trí địa lý cụ thể. Các ví dụ ItemizedOverlay xử lý các bản vẽ, vị trí, nhấp xử lý, tập trung kiểm soát, và bố trí tối ưu của mỗi điểm đánh dấu OverlayItem cho bạn.
Để thêm một lớp marker ItemizedOverlay vào bản đồ của bạn, tạo ra một lớp mới mà kéo dài ItemizedOverlay, Như thể hiện trong Liệt kê 13-18.
ItemizedOverlay là một lớp chung cho phép bạn tạo ra các phần mở rộng dựa trên bất kỳ lớp mà thực hiện OverlayItem.
Trong xây dựng, bạn cần phải gọi thông qua các lớp cha sau khi xác định các giới hạn cho điểm đánh dấu mặc định của bạn. Sau đó bạn phải gọi cư để kích hoạt sự sáng tạo của mỗi OverlayItem; cư phải được gọi là bất cứ khi nào dữ liệu được dùng để tạo ra những thay đổi mặt hàng.
đang được dịch, vui lòng đợi..