{"id":19757511,"url":"https://github.com/stavinli/beijingsubway","last_synced_at":"2025-04-30T12:31:44.096Z","repository":{"id":44119988,"uuid":"160664135","full_name":"StavinLi/beiJingSubway","owner":"StavinLi","description":"北京地铁图","archived":false,"fork":false,"pushed_at":"2023-01-04T19:07:46.000Z","size":604,"stargazers_count":28,"open_issues_count":11,"forks_count":12,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-05T13:13:45.396Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StavinLi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-06T11:18:28.000Z","updated_at":"2023-01-07T06:44:49.000Z","dependencies_parsed_at":"2023-02-02T20:02:07.499Z","dependency_job_id":null,"html_url":"https://github.com/StavinLi/beiJingSubway","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StavinLi%2FbeiJingSubway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StavinLi%2FbeiJingSubway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StavinLi%2FbeiJingSubway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StavinLi%2FbeiJingSubway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StavinLi","download_url":"https://codeload.github.com/StavinLi/beiJingSubway/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224208431,"owners_count":17273771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T03:19:35.906Z","updated_at":"2024-11-12T03:19:36.607Z","avatar_url":"https://github.com/StavinLi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n### 北京地铁图\n\n北京地铁图，基于svg开发，支持PC、移动端多种浏览器。\n![在这里插入图片描述](https://img-blog.csdnimg.cn/20181218084607543.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L20wXzM3Mjg1MTkz,size_16,color_FFFFFF,t_70)\n-  [线上开源地址 https://github.com/StavinLi/beiJingSubway](https://github.com/StavinLi/beiJingSubway) 点个赞吧！\n- [项目预览 暂时无法]\n\n-------------------\n \n\n#### 项目介绍\n\n- 技术点\n\n 1.`node`代理请求`https://map.bjsubway.com/`数据\n```\napp.use('/', proxy({\n    target: 'https://map.bjsubway.com/',\n    pathRewrite: {\n        '^/apis': '' // 重写请求，比如我们源访问的是api/old-path，那么请求会被解析为/api/new-path\n    },\n    changeOrigin: true\n}));\n```\n\n2.请求结果`XML`格式解析\n```\n$.ajax({\n    url: \"/apis/subwaymap/beijing.xml\",\n    dataType: 'xml',\n    type: 'GET',\n    timeout: 5000,\n    success: function(data) {\n        var ls = $(data).find(\"sw\").children()\n        ...\n    })\n});\n```\n3.gulp构建工具，文件打包\n```\n//监控文件变化\ngulp.task('watch', function() {\n    gulp.watch([\"src/css/*.css\", \"src/js/*.js\"], ['default']);\n});\n\ngulp.task('default', function(cb) {\n    runSequence('other', ['css', 'js'], 'html')(cb);\n})\n```\n- 数据来源--北京地铁官网\n\n\n#### 项目安装\n\n\u003e git clone https://github.com/StavinLi/beiJingSubway.git\n\n#### 项目运行\n\u003e 1.环境依赖  `npm i`\n\u003e 2.本地运行 `npm run start` \n\u003e 3.打包运行 `npm run build` \n\n#### 目录结构描述\n```\n├── Readme.md                   //help\n├── dest                        //发布包\n│   ├── css\n│   ├── js                \n│   └── *.html        \n├── libs                        //第三方文件\n├── node_modules                  \n├── rev                         //静态版本json\n├── src                         //开发包\n└── gulpfile.js\n```\n\n#### 更新记录\n\n##### 2018.12.06\n```\n    -  init commit\n```\n##### 2018.12.07\n```\n    -  node 跨求请求xml\n    -  跨域 pathRewrite\n```\n##### 2018.12.10\n```\n    -  require(\"open\") 本地运行打开新窗口\n    -  西二旗坐标空格导致移动端显示错误\n```\n##### 2018.12.19\n```\n    -  新增站点hover 信息\n```\n##### 2018.12.20\n```\n    -  新增自定义线路\n    -  修复少换乘切换相同换乘次数时，未综合考虑时间因素\n    -  新增耗时、途径、换乘、票价\n```\n##### 2018.12.21\n```\n    -  新增起止点转换\n```\n##### 2019.9.6\n```\n    -  node 新增 设置证书免校验\n```\n#### 总结注意\n\u003e 1.line 标签西二旗属性 `lb=\"西二旗\" x=\"757 \"` 其中x属性中空格在移动端造成坐标失效，解决办法： ` $(this).attr(\"x\")*1`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstavinli%2Fbeijingsubway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstavinli%2Fbeijingsubway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstavinli%2Fbeijingsubway/lists"}