Skip to content

Instantly share code, notes, and snippets.

@cshijiel
Created August 20, 2018 05:44
Show Gist options
  • Save cshijiel/8240dc3ccf7f2484814b20a52dc501af to your computer and use it in GitHub Desktop.
Save cshijiel/8240dc3ccf7f2484814b20a52dc501af to your computer and use it in GitHub Desktop.
北京互联网地图
var addressList =
[{"location":{"lat":39.982951,"lng":116.352469},"picture":"i/image2/M01/79/0A/CgoB5ltr2A-AM5SFAADbT9jQCn841.jpeg","shortName":"字节跳动"},{"location":{"lat":40.013643,"lng":116.496031},"picture":"i/image/M00/6A/05/Cgp3O1gW8zSAUwUsAABMptH-XY087.jpeg","shortName":"美团点评"},{"location":{"lat":39.966977,"lng":116.457651},"picture":"image1/M00/00/77/Cgo8PFTUXauAeNlYAABE12ZYmEU829.gif","shortName":"北京麦田"},{"location":{"lat":40.049738,"lng":116.296573},"picture":"i/image/M00/00/20/Cgp3O1YtmkSAZjX1AAA78knErXc273.jpg","shortName":"滴滴出行"},{"location":{"lat":39.982635,"lng":116.313238},"picture":"i/image2/M00/13/95/CgotOVnwNqeAFbmnAABaH5Q_vVE401.png","shortName":"京东集团"},{"location":{"lat":39.984142,"lng":116.320239},"picture":"i/image/M00/5B/50/CgpEMlmIKKmAcuxkAAA5bp2u1EY990.png","shortName":"好未来"},{"location":{"lat":39.994572,"lng":116.340208},"picture":"i/image/M00/43/76/CgpFT1lfM6mAXFUwAABo_6cN6zw428.jpg","shortName":"丽兹行"},{"location":{"lat":40.056974,"lng":116.307689},"picture":"i/image/M00/21/3E/CgpFT1kVdzeAJNbUAABJB7x9sm8374.png","shortName":"百度"},{"location":{"lat":39.989265,"lng":116.321857},"picture":"i/image/M00/90/61/CgpEMlrz4ZeADD25AAA4Y-lUeXc084.jpg","shortName":"地平线机器人"},{"location":{"lat":39.918967,"lng":116.479857},"picture":"i/image/M00/67/87/CgpFT1mpHKCAF5oKAABeE95QxFk132.png","shortName":"宜信"},{"location":{"lat":40.040097,"lng":116.356026},"picture":"i/image3/M00/06/87/Cgq2xlpgCByAMD8nAACUbQvvrew382.png","shortName":"自如网"},{"location":{"lat":39.961914,"lng":116.483765},"picture":"i/image/M00/38/51/CgpFT1lKOQ-AGJHLAAAN2AxGncw939.jpg","shortName":"阿里文娱"},{"location":{"lat":40.047472,"lng":116.311765},"picture":"i/image/M00/01/59/Cgp3O1Zn9kCAAW4jAABX8W4A-fw360.jpg","shortName":"联想集团"},{"location":{"lat":40.06687,"lng":116.417919},"picture":"image1/M00/1C/F0/CgYXBlUnodCAQS-7AABN4-9NsOc293.png","shortName":"明略数据"},{"location":{"lat":39.923589,"lng":116.537324},"picture":"image1/M00/00/01/CgYXBlTUV_OABaFeAABtGUbQoLE148.png","shortName":"聚美优品"},{"location":{"lat":39.957605,"lng":116.427574},"picture":"image1/M00/00/84/Cgo8PFTUXeSAKU0pAAButaDUfeY414.jpg","shortName":"盈泰财富云"},{"location":{"lat":39.94837,"lng":116.358999},"picture":"i/image/M00/75/42/CgpFT1pCBUWATGnFAAECw9lFgMM930.jpg","shortName":"尚德机构"},{"location":{"lat":40.054767,"lng":116.289166},"picture":"i/image2/M01/58/33/CgoB5lshxXWAFMpqAABENXCGmu8813.png","shortName":"跟谁学"},{"location":{"lat":39.982635,"lng":116.313238},"picture":"i/image2/M00/01/B5/CgoB5lm_Z2eAO7g_AAAsw5Ww4Ig707.jpg","shortName":"京东物流"},{"location":{"lat":39.990204,"lng":116.310754},"picture":"image1/M00/00/0C/Cgo8PFTUWCCAPzEiAABxmHO43UY874.JPG","shortName":"开科唯识"},{"location":{"lat":40.074372,"lng":116.240562},"picture":"i/image/M00/4A/76/CgpEMllli-qAYWKDAAAaNfCDIT0057.png","shortName":"北京瑞友"},{"location":{"lat":40.012657,"lng":116.510391},"picture":"i/image/M00/B7/FF/CgqKkVjBBbWAbPjSAABHVeFzZJ0946.png","shortName":"车和家"},{"location":{"lat":39.985024,"lng":116.319569},"picture":"i/image/M00/2E/90/CgpEMlkuZo-AW_-IAABBwKpi74A019.jpg","shortName":"融360"},{"location":{"lat":39.915809,"lng":116.377572},"picture":"i/image/M00/54/9D/CgpFT1mBc8-AKfalAAARFQzMdhg682.png","shortName":"咪咕"},{"location":{"lat":39.92533,"lng":116.463959},"picture":"image1/M00/00/09/Cgo8PFTUWBKAQjtNAAAd8P1R3uQ694.jpg","shortName":"易宝支付"},{"location":{"lat":23.17896,"lng":113.423},"picture":"i/image3/M00/07/83/Cgq2xlpgcIiADaI7AAD3M01Eg7E545.png","shortName":"北明软件"},{"location":{"lat":39.944998,"lng":116.439118},"picture":"i/image/M00/99/BB/Cgp3O1ihGAGAKUgUAAG55-tWef418.jpeg","shortName":"ThoughtWorks"},{"location":{"lat":39.691879,"lng":116.577441},"picture":"image1/M00/31/82/CgYXBlWLxvOAVgoRAAZGmVXIEvE578.png","shortName":"更美APP"},{"location":{"lat":40.052884,"lng":116.294004},"picture":"i/image/M00/66/3A/CgqKkVgJrxqAM4XpAAASCvWXUNo120.png","shortName":"亚创"},{"location":{"lat":40.215324,"lng":116.219733},"picture":"i/image2/M01/79/41/CgoB5ltsEA2ARlroAAAUpiRGi1A045.jpg","shortName":"闪送"},{"location":{"lat":39.946485,"lng":116.3591},"picture":"i/image/M00/2A/99/CgpFT1kuKV6ABHEcAAANeWbfPuM340.jpg","shortName":"哗啦啦"},{"location":{"lat":39.851283,"lng":116.321002},"picture":"i/image2/M00/1D/A1/CgotOVoJXn6ARwRLAAAOmvzO_14107.jpg","shortName":"海知智能"},{"location":{"lat":30.293988,"lng":120.11887},"picture":"i/image/M00/0A/E9/CgqKkVbVQGGAU9B-AAAVMZAPDzE950.jpg","shortName":"兑吧"},{"location":{"lat":39.995786,"lng":116.424451},"picture":"i/image/M00/8A/7C/Cgp3O1h12gSAa4FBAAAVW9Ge7UQ171.jpg","shortName":"包银消费金融"},{"location":{"lat":40.041683,"lng":116.383509},"picture":"i/image/M00/02/B0/Cgp3O1aYTNuARmosAADrNTFD540430.png","shortName":"多牛传媒"},{"location":{"lat":39.966962,"lng":116.328488},"picture":"i/image/M00/6C/81/CgpEMlms_8KACZ0SAAC_BeR_b2I064.jpg","shortName":"清科集团"},{"location":{"lat":39.631332,"lng":115.942829},"picture":"i/image3/M00/1D/8E/CgpOIFqOfZeAbHjCAAAOwPwPzaQ790.png","shortName":"蔬东坡"},{"location":{"lat":39.913346,"lng":116.477852},"picture":"i/image/M00/56/F1/CgpEMll_BCyAeUG5AAALd2c7GKM548.png","shortName":"和信贷"},{"location":{"lat":40.053231,"lng":116.288405},"picture":"i/image/M00/88/FC/Cgp3O1hvU9iAUSleAABKcQtMMC4581.png","shortName":"神州信息"},{"location":{"lat":39.78899,"lng":116.503335},"picture":"i/image/M00/91/32/CgqKkViX35KAJyG2AAAFrYLDpXY131.png","shortName":"天润融通"},{"location":{"lat":39.978888,"lng":116.497184},"picture":"image1/M00/00/02/CgYXBlTUV_SAC4JmAABlUkwC7D0180.png","shortName":"墨迹天气"},{"location":{"lat":39.990068,"lng":116.314128},"picture":"i/image/M00/47/3B/CgqKkVeO8sWAS9d9AAAgP9GL_Zc630.png","shortName":"易到"},{"location":{"lat":39.918299,"lng":116.547268},"picture":"image1/M00/0A/45/CgYXBlTuq5-AZAZGAABoGOytr0c326.jpg","shortName":"卡车之家"},{"location":{"lat":39.798192,"lng":116.592343},"picture":"i/image2/M00/16/37/CgotOVn2yUmAZHdVAAAJdmFhmZU725.png","shortName":"菜鸟网络"},{"location":{"lat":40.011716,"lng":116.435937},"picture":"i/image/M00/54/7F/CgqKkVfD9yqAJ5QyAAAypAzMizU130.jpg","shortName":"友缘在线"},{"location":{"lat":39.99204,"lng":116.484199},"picture":"i/image/M00/01/1F/CgpEMljGiGmAe_9yAADNJO3blso701.png","shortName":"柔持英语"},{"location":{"lat":40.046952,"lng":116.313796},"picture":"i/image/M00/7E/54/CgqKkVhKDXqAe5H-AAB0bD7hfwI255.JPG","shortName":"方正电子"},{"location":{"lat":39.914767,"lng":116.616344},"picture":"i/image3/M00/3A/A2/Cgq2xlqs5FiAYDsbAAAxLWV0zwc605.png","shortName":"美秒科技"},{"location":{"lat":39.911327,"lng":116.478184},"picture":"image1/M00/00/16/CgYXBlTUWEaAaB5jAACYgc4pee4229.png","shortName":"果壳网"},{"location":{"lat":40.186857,"lng":116.16853},"picture":"i/image3/M00/44/2D/CgpOIFq4uMuAFn5ZAAEq2RzfUj4559.png","shortName":"积云教育"},{"location":{"lat":39.934505,"lng":116.308068},"picture":"i/image/M00/47/15/CgpFT1ll1HSAJd7KAABwVghAOK4012.png","shortName":"混沌大学"},{"location":{"lat":40.002781,"lng":116.486387},"picture":"i/image2/M00/0C/FF/CgotOVnh78-ABFZOAAAWRdgVMFM255.jpg","shortName":"易鑫集团"},{"location":{"lat":40.017627,"lng":116.481514},"picture":"i/image2/M00/0B/60/CgotOVneB4eAVqWoAAJPNvKVPJs554.png","shortName":"蓝港互动集团"},{"location":{"lat":40.059285,"lng":116.307829},"picture":"image1/M00/00/42/Cgo8PFTUXM-ALMUkAABqRVXh2jk220.jpg","shortName":"罗辑思维"},{"location":{"lat":40.044517,"lng":116.324181},"picture":"i/image/M00/06/D4/Cgp3O1bNS52ABm7XAABKJUenAqg577.png","shortName":"互动作业"},{"location":{"lat":39.988027,"lng":116.319608},"picture":"i/image/M00/14/EA/CgqKkVbqZuiAaXaMAACL_mOdkj8983.JPG","shortName":"LinkDoc"},{"location":{"lat":39.927668,"lng":116.440184},"picture":"image2/M00/03/8D/CgpzWlXukhWAe_F8AABB_qM0oMg099.jpg","shortName":"Zenjoy"},{"location":{"lat":39.997991,"lng":116.429931},"picture":"i/image/M00/47/E8/CgpFT1lnLN-ASPqMAAALsGxBnNk244.jpg","shortName":"房总管"},{"location":{"lat":39.884056,"lng":116.335625},"picture":"i/image2/M00/04/15/CgotOVnDVsyADHdrAAA1H-vcrvU760.jpg","shortName":"衣二三"},{"location":{"lat":39.913147,"lng":116.480562},"picture":"i/image/M00/4C/77/Cgp3O1eiu6yAOgxzAAAWe9ionuU433.jpg","shortName":"中交兴路"},{"location":{"lat":39.954301,"lng":116.481843},"picture":"i/image/M00/3C/C0/Cgp3O1dwtHiAfZ-TAAAZPGa_pAA199.jpg","shortName":"Moka"},{"location":{"lat":40.037551,"lng":116.423746},"picture":"i/image/M00/04/01/CgqKkVbFXu-AdddWAAAnWoe0cyg923.png","shortName":"途游"},{"location":{"lat":40.031352,"lng":116.412739},"picture":"i/image2/M00/41/46/CgoB5lq94QyAZKcGAAA5MMruKvI17.jpeg","shortName":"汉能集团"},{"location":{"lat":40.030838,"lng":116.307212},"picture":"i/image/M00/2A/27/Cgp3O1cxeHqAdnaPAAA3ytRua4I223.jpg","shortName":"云纵"},{"location":{"lat":39.913923,"lng":116.451258},"picture":"i/image3/M00/18/57/Cgq2xlp31OOAesCnAAFVMywLILQ760.jpg","shortName":"凤凰网房产"},{"location":{"lat":39.993695,"lng":116.340683},"picture":"i/image/M00/37/5E/CgpEMllA756AY77bAACGZNBdYBk118.jpg","shortName":"DataHunter"},{"location":{"lat":40.051304,"lng":116.363052},"picture":"i/image/M00/09/D4/CgpEMljc_3uAKbqkAAAaA-1bxVo89.jpeg","shortName":"乐道互动(北京)科技有限公司"},{"location":{"lat":39.935295,"lng":116.358802},"picture":"i/image/M00/56/C7/CgqKkVfNLemAVgDJAAAR5LKOP5w508.jpg","shortName":"新华书店总店"},{"location":{"lat":40.052567,"lng":116.312143},"picture":"i/image2/M01/5D/3F/CgoB5lswhuqARixLAAEEmqhy410536.jpg","shortName":"意锐"},{"location":{"lat":39.851896,"lng":116.486111},"picture":"i/image/M00/01/40/CgqKkVZlW7iAR-4CAADNlSlAvaM233.png","shortName":"盈嘉互联"},{"location":{"lat":39.917634,"lng":116.547375},"picture":"i/image/M00/3A/AF/Cgp3O1dqDQiAE-clAACOQ1x4tkg533.png","shortName":"橘子娱乐"},{"location":{"lat":39.96586,"lng":116.446976},"picture":"image1/M00/30/A7/Cgo8PFWJMWqAAbUwAACiJnZtkZA602.png","shortName":"当当网"},{"location":{"lat":39.964241,"lng":116.472414},"picture":"i/image2/M00/15/21/CgotOVny7IyAaEzXAAAuVJZgtXk595.jpg","shortName":"网信"},{"location":{"lat":40.042152,"lng":116.313554},"picture":"i/image2/M00/09/7D/CgotOVna8B-ARDuWAAAUKhbSQss213.jpg","shortName":"蚂蚁短租"},{"location":{"lat":40.050842,"lng":116.290158},"picture":"i/image/M00/C0/AD/CgqKkVjTYbSAIbrPAAAuRu5nLZA732.jpg","shortName":"百度视频"},{"location":{"lat":39.754868,"lng":116.507493},"picture":"i/image3/M00/0F/A8/Cgq2xlpprZOAYhlEAAAbKRYMKWI969.png","shortName":"中电进出口"},{"location":{"lat":39.938656,"lng":116.460863},"picture":"i/image/M00/39/B1/CgpFT1lMzJuAYEYmAABjIgi5QXY196.jpg","shortName":"懒投资"},{"location":{"lat":39.913373,"lng":116.664454},"picture":"i/image3/M00/30/8E/CgpOIFqh-c6ACYQXAAAZXXdhXK4976.png","shortName":"畅捷通"},{"location":{"lat":40.100269,"lng":116.42185},"picture":"i/image/M00/00/AE/CgqKkVZSyWaAcfE7AAAxflCqtSU272.png","shortName":"SmartX"},{"location":{"lat":39.923563,"lng":116.419205},"picture":"image1/M00/31/6C/Cgo8PFWLoGuAMagLAAAWBhxKaq4156.jpg","shortName":"正邦创意"},{"location":{"lat":40.250433,"lng":116.132525},"picture":"i/image/M00/4E/57/CgpFT1l1ZeqAabsgAABCTUrAR4g777.png","shortName":"车行168"},{"location":{"lat":39.861341,"lng":116.375172},"picture":"i/image2/M01/64/A2/CgoB5ls90iCAT-K0AABJ9QHmBso043.jpg","shortName":"搜游网络"},{"location":{"lat":39.966074,"lng":116.336626},"picture":"i/image/M00/3B/37/CgpEMllI7ruAZrOKAABQ_5BldYw422.png","shortName":"海致"},{"location":{"lat":39.887297,"lng":116.673354},"picture":"i/image2/M01/58/57/CgotOVsh7FiAQSHTAAA5IRnaqtw064.png","shortName":"资质管家"},{"location":{"lat":39.98277,"lng":116.338623},"picture":"i/image/M00/05/2D/CgpEMljPlnKAdXeAAAB6H5PpYX0652.png","shortName":"纷享销客"},{"location":{"lat":40.011734,"lng":116.270629},"picture":"image1/M00/41/2E/Cgo8PFXIAi2AQu2VAAL8hG1mu_E808.png?cc=0.1682346192164314","shortName":"悟空保"},{"location":{"lat":39.96642,"lng":116.307965},"picture":"i/image2/M01/67/88/CgotOVtEaOCASDycAAATsWQtBhY151.png","shortName":"Trusfort芯盾时代"},{"location":{"lat":39.746081,"lng":116.352239},"picture":"i/image2/M00/24/AB/CgotOVobi-GAen1CAAAkIBsjGV0395.png","shortName":"寓客"},{"location":{"lat":39.987808,"lng":116.3212},"picture":"i/image/M00/02/66/Cgp3O1aOGhmAODz9AABFMfxz2pM213.png","shortName":"天阳科技"},{"location":{"lat":39.839431,"lng":116.440013},"picture":"i/image2/M00/25/F3/CgotOVoeH8mAXLLiAAAkZvvg_c8377.jpg","shortName":"哈弗租赁"},{"location":{"lat":39.995117,"lng":116.482719},"picture":"i/image/M00/57/5A/CgpEMll_8UyABc1WAAAky1KkjXk962.png","shortName":"省广畅思"},{"location":{"lat":39.995633,"lng":116.393509},"picture":"image1/M00/00/0A/CgYXBlTUWBSAZ7jLAAByFxguLS4914.jpg","shortName":"游戏谷"},{"location":{"lat":39.943857,"lng":116.456167},"picture":"image1/M00/38/7C/CgYXBlWl67OASK9lAABOrvc04R0583.png?cc=0.017984452920466798","shortName":"粉丝网"},{"location":{"lat":39.966835,"lng":116.328682},"picture":"i/image/M00/8E/1F/CgpFT1r9FOGADZl1AABCUrZc2mk110.png","shortName":"广视通达"},{"location":{"lat":39.912162,"lng":116.480402},"picture":"image1/M00/0C/F2/CgYXBlT2mG2AOPevAAB_09mD2Ko247.png","shortName":"她理财"},{"location":{"lat":39.91139,"lng":116.466681},"picture":"i/image/M00/4E/B3/CgqKkVesJfyARVP3AAA1XFaXbLA533.jpg","shortName":"ATA"},{"location":{"lat":39.920843,"lng":116.497977},"picture":"i/image/M00/64/AC/CgpEMlmakPOARSsoAABB_aaLYl8385.jpg","shortName":"君理资本"},{"location":{"lat":39.904126,"lng":116.351898},"picture":"i/image2/M00/1E/B5/CgoB5loLtWKARloeAAAHTnHbwXs388.jpg","shortName":"领先未来"},{"location":{"lat":39.986196,"lng":116.503071},"picture":"i/image/M00/C0/B3/CgqKkVjTbRSAUwxqAAA9Njgpx5Q926.jpg","shortName":"蓝标电商"},{"location":{"lat":39.978963,"lng":116.499819},"picture":"i/image3/M00/16/0B/Cgq2xlpyzIyAVDCHAAAcIGWqE6c236.jpg","shortName":"比链科技"},{"location":{"lat":39.983169,"lng":116.487962},"picture":"i/image/M00/75/65/CgqKkVgzwuiAIqwVAAbhEVjDUlk817.png","shortName":"石墨文档"},{"location":{"lat":39.790209,"lng":116.502508},"picture":"image1/M00/1B/BD/CgYXBlUjhpiAAPK4AAAzvDmtz64194.jpg","shortName":"拓维信息"},{"location":{"lat":39.91937,"lng":116.45895},"picture":"i/image/M00/51/99/CgpEMll0ULiAGiLXAAA034TywSo376.png","shortName":"有路网"},{"location":{"lat":39.789053,"lng":116.503483},"picture":"i/image/M00/7E/89/CgpEMlpNkHKAIUycAAAGSa-uKiA553.png","shortName":"云智惠"},{"location":{"lat":40.050407,"lng":116.288582},"picture":"i/image/M00/A4/C0/Cgp3O1irnx2AYQ4qAAAngQGqXE8944.png","shortName":"易企秀"},{"location":{"lat":39.964879,"lng":116.415466},"picture":"image1/M00/14/18/Cgo8PFUHxaOAIfnMAABVFKWQ2VM960.jpg","shortName":"北京盛安德"},{"location":{"lat":39.844237,"lng":116.291381},"picture":"i/image2/M00/09/BA/CgotOVnbLLWAQtatAAAX2MGCBCk192.jpg","shortName":"Alpha Mobile"},{"location":{"lat":39.990389,"lng":116.310942},"picture":"image1/M00/1B/14/CgYXBlUeki2AeqgNAABk7KylXjM858.jpg","shortName":"BJCA"},{"location":{"lat":39.921026,"lng":116.490494},"picture":"i/image2/M01/66/D6/CgotOVtDM_WAa8CiAAAia9LGv6g338.jpg","shortName":"趣快信息"},{"location":{"lat":40.193635,"lng":116.467712},"picture":"image1/M00/3B/66/Cgo8PFWwaQOACAUgAAAcNuMGDw0143.png","shortName":"智慧流教育"},{"location":{"lat":39.920561,"lng":116.526019},"picture":"i/image3/M00/49/55/CgpOIFrPPC6AA4RgAAAUpnvCKh4796.png","shortName":"创客贴"},{"location":{"lat":39.925654,"lng":116.439261},"picture":"i/image/M00/17/7E/CgqKkVbx_DqAb3HrAAAQetzTcJI333.png","shortName":"向上金服"},{"location":{"lat":39.988922,"lng":116.323998},"picture":"i/image/M00/65/34/CgqKkVgHEYOATkFEAAACUwQtjsU344.png","shortName":"西普教育"},{"location":{"lat":30.286126,"lng":120.067148},"picture":"i/image2/M00/4C/8A/CgotOVr5NzWAYm78AAAyXPr2Emw581.png","shortName":"阿里妈妈"},{"location":{"lat":39.975016,"lng":116.497204},"picture":"images/logo_default.png","shortName":"Nuance"},{"location":{"lat":39.888206,"lng":116.334269},"picture":"i/image/M00/0C/93/CgpEMljkjkKAQ1KRAAASMDNQFG4480.jpg","shortName":"梦哆啦"},{"location":{"lat":39.983286,"lng":116.318616},"picture":"i/image/M00/BD/90/CgqKkVjKR9qAUGSrAAAqBqcmfK4957.png","shortName":"爱茂文化"},{"location":{"lat":40.072648,"lng":116.323705},"picture":"i/image/M00/9D/C6/Cgp3O1ikBmeAePiVAAEgOR33FWI672.png","shortName":"蛮蛮云计算"},{"location":{"lat":39.960714,"lng":116.368358},"picture":"image1/M00/14/F4/Cgo8PFUJRY-AWRJeAAChWoGYuKM740.png","shortName":"中国电信系统集成公司"},{"location":{"lat":39.921486,"lng":116.558602},"picture":"image1/M00/0C/6C/Cgo8PFT1X2uAUbGsAABCAddtkWg960.jpg","shortName":"慕课网"},{"location":{"lat":39.903926,"lng":116.32684},"picture":"i/image2/M00/50/F9/CgoB5lsSFAaAFqbbAAA22A1233U913.png","shortName":"团车网"},{"location":{"lat":39.636463,"lng":115.598543},"picture":"i/image/M00/89/A1/CgqKkVhzBUiAVAPnAAA4WxlD0ls304.png","shortName":"Yi+"},{"location":{"lat":39.984274,"lng":116.479862},"picture":"i/image/M00/5D/43/CgpEMlmKvaGALJgTAACGdxdtuOQ510.png","shortName":"摩登天空"},{"location":{"lat":39.990098,"lng":116.314199},"picture":"image2/M00/13/1A/CgpzWlY5s8OAZeBeAABCtz-XiHo710.jpg?cc=0.06203367258422077","shortName":"棕榈大道"},{"location":{"lat":40.002098,"lng":116.487241},"picture":"image1/M00/00/31/CgYXBlTUXIaAH1_mAABgPVFlQsg981.png","shortName":"180"},{"location":{"lat":39.933097,"lng":116.524154},"picture":"i/image/M00/B8/BF/CgqKkVjCE9iAPWSlAACYBjXl-QA201.png","shortName":"智慧树"},{"location":{"lat":39.954158,"lng":116.425205},"picture":"image1/M00/31/05/Cgo8PFWKXb-AMcJdAAAcf2EiLiY139.png?cc=0.6198265145067126","shortName":"万象新动"},{"location":{"lat":40.044791,"lng":116.426006},"picture":"i/image2/M01/57/CC/CgoB5lsgxxWAVP5JAAAjiAffp9w756.jpg","shortName":"印象笔记"},{"location":{"lat":39.932077,"lng":116.614351},"picture":"image1/M00/3E/D2/CgYXBlW-37iAJqfWAAAOe_p11xY677.jpg?cc=0.08405937743373215","shortName":"北京蓝海龙"},{"location":{"lat":39.989427,"lng":116.323862},"picture":"i/image/M00/1F/EC/CgpEMlkK1MuAIlj3AAAT-jNp9v8066.png","shortName":"115科技"},{"location":{"lat":39.983711,"lng":116.50654},"picture":"image1/M00/00/1E/CgYXBlTUWGaAd-zBAABJtxrgzZI848.png","shortName":"世纪互联"},{"location":{"lat":39.959422,"lng":116.331568},"picture":"i/image/M00/01/66/CgqKkVZpVeeANCdvAAAVjSJgAPE326.jpg","shortName":"运营宝"},{"location":{"lat":39.930629,"lng":116.462342},"picture":"i/image2/M00/0C/90/CgoB5lnga82AK5ChAAAWUA3k6xE055.png","shortName":"希悦"},{"location":{"lat":40.013963,"lng":116.356726},"picture":"i/image2/M00/30/9D/CgoB5lo8bcOAWDlXAAAnpJ7z6SI396.png","shortName":"微笑科技"},{"location":{"lat":39.857849,"lng":116.239248},"picture":"i/image3/M00/1C/15/Cgq2xlqBboiAJ2GGAABXbKQkHg4491.png","shortName":"区块科技"},{"location":{"lat":40.217675,"lng":117.210249},"picture":"i/image/M00/2E/98/CgpFT1k2cu-Ae5eNAAEDTPHkf_A479.jpg","shortName":"杏树林"},{"location":{"lat":39.990584,"lng":116.319699},"picture":"i/image/M00/18/62/CgqKkVbzqMiAWxukAAAOXcEweYc538.jpg","shortName":"创业黑马"},{"location":{"lat":39.923305,"lng":116.459937},"picture":"i/image2/M00/48/F0/CgoB5lrhZNuAAmiLAAA0NZ-sYHk392.png","shortName":"HOLLA Group"},{"location":{"lat":39.956778,"lng":116.361469},"picture":"i/image2/M00/4F/DC/CgotOVsOUjGAZXDsAAAiTFEc0hQ219.png","shortName":"慧友云商"},{"location":{"lat":39.948115,"lng":116.355685},"picture":"i/image/M00/67/72/CgpEMlmfytOAQlGXAAA0T44Me8I833.jpg","shortName":"1905电影网"},{"location":{"lat":39.915185,"lng":116.283236},"picture":"i/image/M00/13/4A/CgpEMljvG_WADSK5AACsWo5llDE223.jpg","shortName":"盒饭LIVE"},{"location":{"lat":39.947942,"lng":116.441857},"picture":"image1/M00/00/03/CgYXBlTUV_mAHKvEAAN_QA3AhYk120.png","shortName":"世纪佳缘"},{"location":{"lat":39.947348,"lng":116.359167},"picture":"i/image/M00/1E/8F/CgpEMlkIbw-AQ_WHAAEPywTu8Tg433.png","shortName":"多拉智能"},{"location":{"lat":39.98526,"lng":116.335299},"picture":"i/image/M00/18/B7/CgpFT1kBf9qAJNjFAADLEGr2qm4990.jpg","shortName":"轩宇空间科技有限公司"},{"location":{"lat":39.805841,"lng":116.509827},"picture":"image1/M00/25/CD/Cgo8PFVSxbCAOyNNAABbtSljJtk636.jpg","shortName":"国富瑞数据CIDS"},{"location":{"lat":40.023518,"lng":116.472873},"picture":"i/image/M00/2B/B1/CgqKkVc1nRSAJHlnAAAacZ6WDps056.png","shortName":"惠民网"},{"location":{"lat":39.868856,"lng":116.548691},"picture":"i/image/M00/12/E5/CgpFT1j11xeAOfCwAACAr9k0go4914.png","shortName":"同道金融"},{"location":{"lat":39.993762,"lng":116.340597},"picture":"i/image/M00/29/27/CgpFT1knvRqAObm4AAAdKAppGP0921.jpg","shortName":"众行传播"},{"location":{"lat":40.015993,"lng":116.355314},"picture":"i/image2/M00/13/C0/CgoB5lnwYE-AO1JdAABGvT5xkkE303.png","shortName":"Max+&小黑盒"},{"location":{"lat":39.981655,"lng":116.500182},"picture":"i/image/M00/6B/09/CgpEMlmozEGAAbIyAABT202AOZc230.jpg","shortName":"AA租车"},{"location":{"lat":39.930183,"lng":116.60504},"picture":"image1/M00/29/6E/Cgo8PFVldAGAHcQwAAAmy4Z7_ns383.jpg","shortName":"Infini Studio"},{"location":{"lat":39.983574,"lng":116.322873},"picture":"i/image3/M00/39/6C/Cgq2xlqrNhmASUppAAA13p3YDmQ347.png","shortName":"爱泊车"},{"location":{"lat":39.99887,"lng":116.337829},"picture":"i/image2/M01/71/68/CgoB5ltZd1WAQT2jAAC4N0wxHMo169.jpg","shortName":"聚力维度"},{"location":{"lat":40.047789,"lng":116.363379},"picture":"i/image/M00/9C/21/CgqKkViiqYWAaWcUAAAOh-nxHA8097.png","shortName":"香哈网-xiangha.com"},{"location":{"lat":39.963259,"lng":116.293126},"picture":"i/image/M00/89/04/CgpFT1rdVxGAM2y7AAAoe1m1_08768.PNG","shortName":"画时代"},{"location":{"lat":40.025519,"lng":116.35789},"picture":"i/image/M00/80/35/CgqKkVhPufaAIOMCAAA8h2dhxDk600.png","shortName":"学习宝"},{"location":{"lat":39.979312,"lng":116.426795},"picture":"i/image2/M00/2F/79/CgoB5lo6CVaAAmQrAAALWc89Z2M381.png","shortName":"呜哩"},{"location":{"lat":39.768736,"lng":116.522034},"picture":"i/image/M00/2F/E9/CgpEMlkxABOAIfjbAAJvl-U-OmU896.jpg","shortName":"程创科技"},{"location":{"lat":39.996742,"lng":116.286753},"picture":"i/image/M00/88/0F/CgpFT1rXJuiAVaOiAACbPVRSN1c653.png","shortName":"vipcode"}]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<style type="text/css">
body, html, #allmap {
width: 100%;
height: 100%;
overflow: hidden;
margin: 0;
}
.BMap_bubble_content {
text-align: center !important;
}
</style>
<script type="text/javascript"
src="http://api.map.baidu.com/api?v=2.0&ak=5d2471754fe14eae275443d33087c4c5"></script>
<script src="companys.js"></script>
<title>设置点的新图标</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
// 百度地图API功能
var map = new BMap.Map("allmap"); // 创建Map实例
// 百度地图API功能
map.setMapStyle({style: 'grayscale'});
map.centerAndZoom(new BMap.Point(116.404, 39.915), 12); // 初始化地图,设置中心点坐标和地图级别
map.setCurrentCity("北京"); // 设置地图显示的城市 此项是必须设置的
map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
var addCompanyMarker = function (map, item) {
var sContent =
"<h4 style='margin:0 0 5px 0;padding:0.2em 0;text-align: left;'>" + item.shortName + "</h4>" +
"<img style='margin:4px'src='https://www.lgstatic.com/" + item.picture + "' width='150' height='150'/>";
var point = new BMap.Point(item.location.lng, item.location.lat);
var marker = new BMap.Marker(point);
var infoWindow = new BMap.InfoWindow(sContent); // 创建信息窗口对象
map.addOverlay(marker);
map.openInfoWindow(infoWindow, point); //开启信息窗口
};
var index = 0;
setInterval(function () {
addCompanyMarker(map, addressList[index++]);
}, 1000);
</script>
package com.roc.test;
import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Builder;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.junit.Test;
import org.springframework.util.CollectionUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
public class InternetMap {
private String BD_MAP_URL = "http://api.map.baidu.com/place/v2/search?query=%s&region=北京&output=json&ak=5d2471754fe14eae275443d33087c4c5";
private String ak = "5d2471754fe14eae275443d33087c4c5";
OkHttpClient client = new OkHttpClient();
@Test
public void loopJobs() throws IOException {
List<AddressVO> addressVOS = new ArrayList<>();
for (int i = 1; i < 200; i++) {
// 2 北京 6 杭州 252 成都
String url = "https://www.lagou.com/gongsi/2-0-0.json?first=false&pn=" + i + "&sortField=1&havemark=0";
// https://www.lagou.com/gongsi/6-0-0.json?first=false&pn=1&sortField=1&havemark=0
String message = this.executeGet(url, 2000);
CompanyPage companyPage = JSON.parseObject(message, CompanyPage.class);
List<CompanyPage.Company> companyList = companyPage.getResult();
for (CompanyPage.Company company : companyList) {
String companyFullName = company.getCompanyFullName();
String companyShortName = company.getCompanyShortName();
AddressPage.Address.Location location = this.getLocation(companyFullName, companyShortName);
if (location == null) {
continue;
}
double lng = location.getLng();
double lat = location.getLat();
String msg = companyFullName + "\t" + "(" + lng + "," + lat + ")" + "\t" + company.getCompanyLogo();
System.out.println(msg);
AddressVO vo = AddressVO.builder()
.location(location)
.shortName(companyShortName)
.picture(company.getCompanyLogo())
.build();
addressVOS.add(vo);
}
System.out.println(JSON.toJSONString(addressVOS));
}
}
private AddressPage.Address.Location getLocation(String companyFullName, String companyShortName) {
AddressPage.Address.Location location = getLocation(companyFullName);
if (location == null) {
location = getLocation(companyShortName);
}
return location;
}
private AddressPage.Address.Location getLocation(String companyFullName) {
String mapUrl = String.format(BD_MAP_URL, companyFullName);
String addressPageString = this.executeGet(mapUrl);
AddressPage addressPage = JSON.parseObject(addressPageString, AddressPage.class);
AddressPage.Address.Location location = Optional.ofNullable(addressPage)
.filter(item -> item.getStatus() == 0)
.map(AddressPage::getResults)
.filter(list -> !CollectionUtils.isEmpty(list))
.map(list -> list.get(0))
.map(AddressPage.Address::getLocation)
.orElse(null);
return location;
}
private String executeGet(String url) {
return this.executeGet(url, 2000);
}
private String executeGet(String url, long millis) {
Request request = new Request.Builder()
.url(url)
.header("Referer", "https://www.lagou.com/gongsi/2-0-0?sortField=1")
.build();
Response response = null;
try {
response = client.newCall(request).execute();
String res = response.body().string();
checkResponse(url, res);
return res;
} catch (Exception e) {
long newMillis = millis * 2 + (int) (Math.random() * millis);
System.out.println("newMillis: " + newMillis);
try {
Thread.sleep(newMillis);
} catch (InterruptedException e1) {
e1.printStackTrace();
}
return executeGet(url, newMillis);
}
}
private void checkResponse(String url, String res) {
if (url.contains("json")) {
Boolean success = JSON.parseObject(res).getBoolean("success");
if (success != null && !success) {
throw new RuntimeException("获取失败");
}
}
}
@Data
public static class CompanyPage {
private int pageSize;
private String start;
private String totalCount;
private int pageNo;
private List<Company> result;
@Data
public static class Company {
private int companyId;
private String companyFullName;
private String companyShortName;
private String companyLogo;
private String city;
private String industryField;
private String companyFeatures;
private String financeStage;
private String companySize;
private int interviewRemarkNum;
private int positionNum;
private int processRate;
private int approve;
private int countryScore;
private int cityScore;
}
}
@NoArgsConstructor
@Data
public static class AddressPage {
private int status;
private String message;
private List<Address> results;
@NoArgsConstructor
@Data
public static class Address {
private String name;
private Location location;
private String address;
private String province;
private String city;
private String area;
private String street_id;
private int detail;
private String uid;
@NoArgsConstructor
@Data
public static class Location {
private double lng;
private double lat;
}
}
}
@Data
@NoArgsConstructor
@Builder
@AllArgsConstructor
public static class AddressVO {
String shortName;
AddressPage.Address.Location location;
String picture;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment