package expo.modules.gaodemap.map.overlays import expo.modules.kotlin.modules.Module import expo.modules.kotlin.modules.ModuleDefinition /** * Marker 视图 Module */ class MarkerViewModule : Module() { override fun definition() = ModuleDefinition { Name("MarkerView") View(MarkerView::class) { Events("onMarkerPress", "onMarkerDragStart", "onMarkerDrag", "onMarkerDragEnd") // 纬度 Prop("latitude") { view, lat -> view.setLatitude(lat) } // 经度 Prop("longitude") { view, lng -> view.setLongitude(lng) } // 位置 Prop?>("position") { view, position -> view.setPosition(position) } // 标题 Prop("title") { view, title -> view.setTitle(title) } // 副标题 Prop("snippet") { view, snippet -> view.setDescription(snippet) } // 是否可拖拽 Prop("draggable") { view, draggable -> view.setDraggable(draggable) } // 图标 Prop("icon") { view, icon -> view.setMarkerIcon(icon) } // 图标颜色 Prop("pinColor") { view, color -> view.setPinColor(color) } // 透明度 Prop("opacity") { view, opacity -> view.setOpacity(opacity) } // 是否平铺 Prop("flat") { view, flat -> view.setFlat(flat) } // 层级 Prop("zIndex") { view, zIndex -> view.setZIndex(zIndex) } // 锚点 Prop>("anchor") { view, anchor -> view.setAnchor(anchor) } // 图标宽度 Prop("iconWidth") { view, width -> view.setIconWidth(width) } // 图标高度 Prop("iconHeight") { view, height -> view.setIconHeight(height) } // 内容宽度 Prop("contentWidth") { view, width -> view.setContentWidth(width) } // 内容高度 Prop("contentHeight") { view, height -> view.setContentHeight(height) } // 缓存key Prop("cacheKey") { view, key -> view.setCacheKey(key) } // 平滑移动路径 Prop?>("smoothMovePath") { view: MarkerView, path -> view.setSmoothMovePath(path) } // 平滑移动时长(秒) Prop("smoothMoveDuration") { view, duration -> view.setSmoothMoveDuration(duration) } // 生长动画 Prop("growAnimation") { view, enable -> view.setGrowAnimation(enable) } } } }