简体   繁体   中英

Connecting U.S. States with MapLines in AmMaps without specifying coordinates?

I am retrieving signals from different cities in the US at different times and want to connect all of them with lines, however, I am not getting the exact coordinates of the signals. Is this possible to substitute the coordinates with the State using AmCharts.AmMaps ?

No, lines require coordinates in AmMaps. As an alternative, you can use getObjectById in conjunction with getAreaCenterLatitude and getAreaCenterLongitude to dynamically find out the lat/long center of an area and use those values. Note that some states need some adjustments as their centers aren't exactly where you expect them. You can see this override in action in this demo where labels are automatically generated but uses a lookup table with overrides for specific states.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM