初遇Citymaker (一)

今天来分享下 基于citymaker 构建快速的封装的gis库的故事

针对citymaker 常用的判断textInfo

  • let textInfo = {
  • GENERAL:{
  • GET_IT:'我知道了',
  • DOWNLOAD:'前往下载'
  • },
  • MAC:{
  • INFO:'您的系统是 Mac OSX 系统,只支持二维地图功能,如要使用三维地图,请更换 Windows 系统',
  • },
  • BROWSER:{
  • SOUGOU:{
  • INFO:'浏览器不支持citymaker,请更换IE11或搜狗浏览器'
  • }
  • },
  • RUNTIME:{
  • INFO:'您没有 CityWorks runtime'
  • }
  • };
  •  
  • export {textInfo};

针对帮助creatMessageBox, 如果没装citymaker插件
``javascript export function creatMessageBox(content, confirmText, callback) { confirmText = confirmText || '确定'; var contentText = content || '不支持三维'; var nodeWrap = document.createElement('div'); nodeWrap.setAttribute('class', 'cityworks_message_box_ct'); nodeWrap.innerHTML =

错误提示 

 ${content}


; document.body.appendChild(nodeWrap); var headNode = document.getElementsByTagName('head')[0]; var styleNode = document.createElement('style'); headNode.appendChild(styleNode); styleNode.setAttribute('class', 'cityworks_message_box_ct_style'); styleNode.innerHTML =
.cityworks_message_box_ct {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
text-align: center;
background: rgba(0, 0, 0, .68);
z-index: 9999;
}
  • .cityworks_message_box_ct:after {
  • content: "";
  • display: inline-block;
  • height: 100%;
  • 0;
  • vertical-align: middle;
  • }
  •  
  • .message_box {
  • display: inline-block;
  • 436px;
  • height: 204px;
  • background: #000;
  • background-color: #fff;
  • opacity: 1;
  • }
  •  
  • .message_box_head {
  • height: 48px;
  • background: rgba(0, 177, 255, 1);
  • display: flex;
  • align-items: center;
  • justify-content: space-between;
  • padding-left: 14px;
  • padding-right: 19px;
  • }
  •  
  • .message_box_head_text {
  • font-size: 12px;
  • font-family: MicrosoftYaHei;
  • color: rgba(255, 255, 255, 1);
  • font-weight: normal;
  • }
  •  
  • .message_box_head_svg {
  • 15px;
  • height: 15px;
  • cursor: pointer;
  • }
  •  
  • .message_box_content {
  • display: flex;
  • align-items: center;
  • justify-content: center;
  • height: 92px;
  • border-bottom: 1px solid #E8E8E8;
  • padding: 0 15px;
  • }
  •  
  • .message_box_content_svg {
  •  
  • }
  •  
  • .message_box_content_text {
  • font-size: 12px;
  • font-family: MicrosoftYaHei;
  • color: rgba(95, 132, 159, 1);
  • margin-left: 7px;
  • text-align: left;
  • }
  •  
  • .message_box_footer {
  • height: 64px;
  • display: flex;
  • align-items: center;
  • justify-content: flex-end;
  • padding-right: 21px;
  • }
  •  
  • .message_box_footer_button {
  • 76px;
  • height: 28px;
  • font-size: 12px;
  • font-family: MicrosoftYaHei;
  • border-radius: 2px;
  • text-align: center;
  • outline: none;
原文地址:https://www.cnblogs.com/haibalai/p/15829012.html