当前位置: 首页 > wzjs >正文

电商平台网站建设合同超炫酷的网站

电商平台网站建设合同,超炫酷的网站,品牌营销活动策划方案,暴雪被谁收购了截至2025年03月21日天地图的Marker不支持添加Label; 同时Label和Icon是不支持自定义HTMLElement只支持String;目前只有InfoWindow支持自定义HTMLElement; 效果图 React核心api import ReactDOM from react-dom/client const content document.createElement(div);…

截至2025年03月21日天地图的Marker不支持添加Label; 同时Label和Icon是不支持自定义HTMLElement只支持String;目前只有InfoWindow支持自定义HTMLElement;

效果图

在这里插入图片描述

React核心api
import ReactDOM from 'react-dom/client'
const content = document.createElement('div');
ReactDOM.createRoot(content).render((<CurLineInfoWindowContent optionsClick={curInfoWindowClick}/>
));
天地图InfoWindow
// 创建
const infoWin = new T.InfoWindow();
// 开启
map.openInfoWindow(infoWin, e.lnglat)
// 关闭
map.closeInfoWindow(infoWin);
// 插入自定义
infoWin.setContent(content: String | HTMLElement);

场景模拟: 点击线弹出编辑和删除

自定义组件_编辑/删除
import style from './style.module.less';
const CurLineInfoWindowContent = ({optionsClick}: any) => {// 你的React组件,包含编辑和删除按钮return (<div className={style.custom_line_window_wrap}>{/* <span className={style.custom_line_window_name}>路线: {linePathNum} (个点)</span> */}<button onClick={(event: any) => {const currentTarget = event.currentTarget;currentTarget.disabled = true;setTimeout(() => { currentTarget.disabled = false; }, 250);optionsClick(0);}}>点编辑</button><button className={style.del_button}onClick={(event: any) => {const currentTarget = event.currentTarget;currentTarget.disabled = true;setTimeout(() => { currentTarget.disabled = false; }, 250);optionsClick(1);}}>删除</button></div>);
};
天地图创建线和绑定事件
/* 创建线 */
var points = [];
points.push(new T.LngLat(116.41239, 39.97569));
points.push(new T.LngLat(116.412799, 39.9068));
points.push(new T.LngLat(116.32970, 39.92940));
points.push(new T.LngLat(116.385440, 39.90610));
var polyline = new T.Polyline(points , {weight: 6,color: '#3366FF'
});
/* 创建infoWindow */
const infoWin = new T.InfoWindow();
// 创建一个div
const content = document.createElement('div');
// 绑定自定义组件事件
const curInfoWindowClick(action: number){switch(action){case 0:{ // 处理编辑逻辑polyline.enableEdit();}break;case 1:{ // 处理删除逻辑map.removeOverLay(polyline);}break;default:break;}
}
// 将React组件渲染到DOM 
ReactDOM.createRoot(content).render((<CurLineInfoWindowContent optionsClick={curInfoWindowClick}/>
));
// 插入到infoWindow
infoWin.setContent(content);
/* 绑定事件 */
// 绑定点击事件
polyline.addEventListener('click', (e: any) => {map.openInfoWindow(infoWin, e.lnglat)
});
// 如果线被移除了_顺手把弹窗给隐藏掉
polyline.addEventListener('remove', (e: any) => {map.closeInfoWindow(infoWin);
});
http://www.dtcms.com/wzjs/818200.html

相关文章:

  • 做python项目的网站做简单网站怎么做
  • 网站开发用px好还是em好seo sem sns的区别
  • 厦门网站排名优化费用个人免费展示网站
  • 郑州商务网站建设如何制作软件程序
  • 惠州网站建设电话wordpress qtranslate
  • 做英文网站賺钱淄博网页设计师招聘
  • 企业建设网站的步骤是什么网站建设优化加盟代理
  • 个人网站和企业网站的区别电子商务主要学什么主要干啥
  • 网站跟别的做的一样的网站多语言版本
  • 移动网站转换环球贸易网网址
  • 网站优化建设哈尔滨企业网站建设自己的官网
  • 中国建设教育协会网站查wordpress 怎么安装插件
  • 苏州高端网站建设定制wordpress 建门户网站
  • 做网站的核验单 是下载的吗三亚北京网站建设
  • 公众号h5网站开发统一e商城app下载
  • 一般哪些商家需要建设网站国内网站备案流程图
  • 运城 网站 建设 招聘wordpress评论样式
  • 深圳哪家制作网站好网站开发中设计登录界面
  • 河北衡水建设网站公司电话网页游戏排行榜前十名2023
  • 网站建设培训西安哈尔滨网站备案手续费
  • 大学网站建设的目标与思路中国商标网官方查询系统
  • 如何做快递api接口网站桂林象鼻山照片
  • 建湖专业做网站的公司公司网站的开发策略
  • wordpress 安装 数据库连接错误宁波网站优化方法
  • 友情链接交换网站微商营销软件商城
  • 一么多设计公司关键词优化的五个步骤
  • 招工网站怎么做东海做网站公司
  • 广安网站建设公司学历提升机构的套路
  • 时光慢网站建设方案论文seo网络优化公司
  • 网站页面设计代码谷歌推广关键词匹配