Closed tianr1190 closed 8 years ago
因为海南岛的右下角还有个小岛 “三沙市”,可以在 geoJson 中去掉,或者 registerMap 的第二个参数设置这个区域的包围盒更靠近海南岛,参考 http://echarts.baidu.com/gallery/editor.html?c=map-usa
不能够啊, 容器还有那么多空白的地方。把海南省包括三沙市布满整个容器,应该是足够大的了。 有没有可以设置缩放级别的参数呢? 查了一下没找到可以设置缩放比例的参数。
实际上我给的容器是这么大:1140px, 800px 可以看出来海南省包括三沙市只占用了一点点的位置。空白的地方还有很多。 而其他省份显示是这样: 能够足够大的布满容器的大部分区域。
知道了, 在海南底下还有很多看不见得小点点,那些小岛都属于三沙市。这些占到大部分的面积。
我想改一下这个三沙市的地图,只留文字旁边的几个小岛,这样不显示完整的三沙市而只显示文字旁边的几个小岛。这样就能完整的显示整个海南的城市。 可是在geoJson里面看了半天,没看懂。。。。。不知道各个成员的含义用途
请教一下,如果想保留三沙市文字旁边的几个小岛,下面的其他小岛都删除掉,应该怎么改下面段呢?
{"id":"460300","geometry":{"type":"MultiPolygon","coordinates":[["@@KCOLAJBJDDVFRHJB\JfVXFZBRATGPMHS@KGKOKqO[QUGQCOAGFCZDFLA\ALHHNLHNFT@JDBJELYAiQaEQESQ","@@HCFCFEBGEKMAMLCHAH","@@KDEFShGJSNGJGJIFCF@HBHDDDBXE^QbcR]DICMCGIC","@@k^AXNV\AcFOGWMMO@UDKH","@@HBJCBGEAKB","@@@DD@BA@AC@","@@DBB@BCAAC@","@@AAOHCLAVHPNHZJ|XLRKDKOYm]YEUIWQ","@@CdNbRNZINOFYIYYOSB","@@AZN^RHXKH[@WOG]B","@@HTHJjZLBNBTFNBRBNFXIKHGHOAMKOOGKIKCeAsGSCMBOHGHMH","@@hNpJxHfFVF\\BL@PKHYCSOG¯F_GYI[QmOU@cFGF@RNPbP","@@yHEHAXDNLTTNPDLBªVfLNRARED@FQFSCQ[_MIOG[GI","@@BEAsKISASfI
DTVRTC","@@@SEagBKjTZfE","@@EAUAWDIR@TNNbX\PVDROCWGW","@@RaOaa@YTRbbP","@@FA\QBEAESUCCOBGD@DBfDF","@@ICIB@BJHFA","@@GCIBADJFHA","@@VuKogEcbEld","@@\\c]_gA]TClbR","@@AIKD@JH@","@@NOG[UKUHWVEZLNdE","@@RG^WF]EISKklEV","@@DHFDRGHGAoOCWN","@@LRVBxO@a_SUCQJIL","@@DHPRfVTJF@
KBA@EQWWYuWEACBGLCT","@@PJHAJ@HWOCQA","@@LAJKGMKDGD@J","@@LJLBNIJMDMCIECKAMFGDIV","@@@BLDNEJKCGIIICIFGF","@@MGIBGF@HHPTD","@@\CDE@IEOKEC@GDEHALDP","@@LgaoNEh\\","@@FHJFNABGGKSGEB","@@b^jFdOVgQcmCkFaP","@@xNRaMoiQQ
AT","@@nyBKISUIQIeA]FinB\FJZNHDFDPARD","@@\RXABGEKOKUIMCODBNHH","@@QwQKoBELARIVLNXN\AVE","@@BCCMAEICHYGMMEQ@OLOXMN@RNJVZRA\W","@@@DATe@WAOCKGIq@UFEVHP@\\BLPP","@@\\EDCBQAEKKKqGE@[T@FBNHTP
f`","@@JAPGRUDI@KCMUOEAw@GDCN@THTVRNH","@@lOQe[SeRHf","@@@\DHRNPFNDNARCR]@IAKIUECGA}@GBCH","@@DRNVZNH@TENKBGD@KMOUII@MDIFKJEH","@@BhBDRNPFFAF@RKFQBKAMGIIEYCG@QH","@@BNTX\RLBHCPcBM@gEYII]CWFILEX","@@DjHVJF\DDA@UCwACEA]DIB","@@PbFDDDnBFCF]AKGI[KS@IDMN","@@L^FDdHzILGLq@G]GAgPo`GN","@@LFHRDN@ROLOHs@kSWMEGBYVGLGV","@@@JTTVANELGnHsGSecEAEHOªGN","@@BjV\lP|DbI@iK]wccKeD","@@DHdNrATSFMEWaaICiAEFKd","@@HLpRLEBMAK]K@kNEJ","@@FHJ^NRB^EFEFMBc{ICwBGD","@@DPLPLHZ@JODYESOMQEMHIL","@@BNJLLDrBREV]TaRWDSBWCQOG[BYDgVWRITENAX","@@BDNN\PF@PCBCB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HrPZt","@@GBAFFJFBnBLBbJTLFLDTANINIHUDS@GEUCCWDYJKBABAF@DLDZ@rC²XPBPCPINKPaBMI]a_iUaGUAMB","@@FBF@BEDA@CEAABACC@CFAD","@@BBJFP@LCJIHUEIMAMDKLEJ","@@AJBDFDHAFEDIACICEB","@@FFJFFAFEAGECEAI@CD@B","@@@FDBLBVADEBCAGGCKCIBGF","@@BPNRDBJ@VAVM@C@MCIKWCCO@UFEHGP"]],"encodeOffsets":[[[114139,17488],[114143,17487],[115046,17318],[114920,17162],[115340,16968],[114394,16944],[114402,16941],[115208,16862],[115350,16779],[115376,16724],[114662,16716],[115108,16687],[115177,16386],[117685,16422],[117546,16276],[114928,16073],[117361,16025],[117008,15924],[120664,15498],[120647,15482],[120115,11344],[120516,11315],[117327,11037],[120028,10993],[118561,10794],[118504,10717],[118537,10713],[117128,10447],[116768,10265],[117331,10198],[117292,10125],[117334,10121],[117045,10091],[117199,10052],[117468,9971],[115666,9869],[115213,9774],[116907,9610],[118761,9546],[114208,9500],[119552,9274],[116674,9088],[117547,8357],[117611,7419],[116327,7130],[115256,6123],[114700,3943],[114916,3974],[114943,4040],[115229,5934],[115172,5878],[115047,5757],[115162,5626],[115224,5792],[115286,5696],[115315,5497],[115259,5233],[115355,5230],[115618,5113],[115935,6458],[116629,8198],[116840,8294],[117257,8316],[117423,8408],[117626,8176],[117708,7690],[116631,7790],[117932,8588],[118025,8714],[118282,8695],[112092,7521],[112575,8037],[113111,8312],[113112,7987],[113264,8204],[114217,7726],[114351,7835],[114232,7996],[114319,8097],[114612,8265],[115602,8033],[115656,8612],[115985,8322],[115940,8268],[116389,9453],[116366,9193],[116935,8975],[117350,9059],[116713,9086],[115563,9760],[115582,9803],[115601,9815],[115638,9855],[115647,9865],[115714,9887],[114383,9538],[114139,8730],[114901,9048],[114939,9088],[115043,9141],[115239,9059],[115532,9125],[118618,9943],[118831,10338],[118941,9810],[119266,10046],[119065,9093],[116999,10061],[116324,10487],[117089,9988],[117369,10205],[116976,10393],[117041,10421],[116985,10488],[117286,10501],[117443,10595],[117318,10662],[117608,11086],[117450,11269],[117320,11593],[117217,11097],[117241,10975],[117442,11745],[117311,11010],[116929,11294],[117669,11124],[119985,10861],[120455,10884],[118622,11107],[119438,10757],[119637,10729],[120073,10569],[120165,10333],[120082,10949],[120598,11033],[120269,11331],[119831,11331],[119529,11778],[118131,14284],[119496,16738],[120534,15547],[117457,16559],[117196,16419],[116955,16426],[116674,16216],[116627,16047],[116445,15975],[116594,15849],[116718,15790],[116977,15806],[117205,15974],[116691,9053],[116500,7821],[117302,10182],[114910,9080],[118496,10787],[118482,10760],[119225,10034],[115706,19940],[116565,19619],[116844,16389],[114927,17405],[115039,17227],[115597,17187],[115428,17077],[113865,16169],[114176,16847],[114254,16879],[114265,16901],[114280,16933],[114336,16963],[114371,16963],[114372,16986],[114421,16854],[114392,16849],[117134,11742],[117095,11726],[117075,11704],[117044,11663],[117543,11420],[117058,11319],[117000,11341],[117026,11320],[116805,11180],[117110,10628],[117158,10638],[117226,10628],[117094,10421],[116579,10260],[117138,10138],[117073,10127],[117022,10092],[116997,10004],[117019,9946],[117142,10031],[117240,10088],[118603,11077],[118583,10988],[118135,10502],[118050,10437],[118274,10155],[118207,9620],[119285,10646],[119315,9976],[119355,9980],[119394,9970],[119253,9395],[114338,8881],[114610,8852],[114444,16448],[117283,10971],[117171,10929],[117097,10989],[115689,9883],[116524,7551],[117267,10171],[117254,10160],[117205,10142],[117261,10110],[117209,10077],[119734,9690],[117371,11707],[117418,7773],[115986,6518],[114385,16599],[114330,16646],[114417,16587],[115732,9895],[115730,9909],[117049,10113],[116962,10456],[116960,11327],[117745,11345]]]},"properties":{"cp":[112.34882,16.831039],"name":"三沙市","childNum":233}}
coordinates下用逗号分隔的一个个UTF-8字符串,每个字符串都是一片区域,你可以删掉后面那些试试
encodeOffsets 这个表示什么意思呢? childNum应该是表示小岛的数量吧?
嗯 childNum 是多边形区域数量,encodeOffsets 是解压需要的信息,跟 coordinates 一一对应
可以了, 只保留三沙市前面三个岛显示效果就挺好。效果是这样: 非常感谢 @pissang
三沙市的geoJson数据修改后如下: {"id":"460300","geometry":{"type":"MultiPolygon","coordinates":[["@@KCOLAJBJDDVFRHJB\JfVXFZBRATGPMHS@KGKOKqO[QUGQCOAGFCZDFLA\ALHHNLHNFT@JDBJELYAiQaEQESQ","@@HCFCFEBGEKMAMLCHAH","@@KDEFShGJSNGJGJIFCF@HBHDDDBXE^QbcR]DICMCGIC"]],"encodeOffsets":[[[114139,17488],[114143,17487],[115046,17318]]]},"properties":{"cp":[112.34882,16.831039],"name":"三沙市","childNum":3}}
你的Echarts是版本几,为什么我删除coordinates的几个数组以后会不能加载海南的地图。而且我用你写的三沙市的geoJson也还是不能加载海南地图了?这是为什么
当时用的ECharts 版本是3.0 @zhuiluo0987
修改json以后地图不能使用,似乎是coordinates的值和你的数据不一样,但是使用我这边原本的数据也不行,求修改后的json代码
我三沙市只留了一个岛;
{ "id": "460300", "geometry": { "type": "MultiPolygon", "coordinates": [["@@HCFCFEBGEKMAMLCHAH"]], "encodeOffsets": [[[115046, 17318]]] }, "properties": { "cp": [112.34882, 16.831039], "name": "三沙市", "childNum": 3 } },
然后在echarts.registerMap的specialAreas参数加入
{ 三沙市: { left: 110.63119, top: 18.031971, width: 0.05 } },
具体调整查看https://echarts.apache.org/zh/api.html#echarts.registerMap
问题简述 (One-line summary)
海南地图通过json加载后,显示出来的地图很小。同样的option其他省份加载json后显示出来的大小正常。
版本及环境 (Version & Environment)
重现步骤 (Steps to reproduce)
1. 2.
期望结果 (Expected behaviour)
期望海南也跟其他省份一样正常的显示大小。
可能哪里有问题 (What went wrong)
ECharts配置项 (ECharts option)
其他信息 (Other comments)
海南:
广东省: