Successfully!

Error!

Map Center Point Calculation Rule

  • Last update:  2021-03-15
  • I. Description

    When writing the map JSON, some customers may not understand the calculation logic of the map center point clearly, so that the area clicked during drilling cannot be located to the map center. After clicking some areas, the area is not displayed in the center of the map. The normal logic display should Is the following effect:

    1.gif

    II. Introduction to Map Center Point Calculation Rules

    Take the maximum and minimum values of latitude and longitude, and take the average to get the center.

    The north latitude is greater than 0; the south latitude is less than 0;

    East longitude is greater than 0; West longitude is less than 0;

    But longitude, if the area crosses the east-west longitude, the center point of this calculation may not be needed, and the longitude needs to be processed into the same symbol.

    E.g:

    Aleutian Islands to Greenland Island, the longitude is about 170 to -20, (170-20) / 2 = 75

    In this way, it is not the desired result that the center of the Americas is in Eurasia.

    So record the longitude of the Aleutian Islands as 170-360 = -190, (-190-20) / 2 = -105

    This -105 degrees is in the American continent.

    Note: If you use our map editor to edit, the editing result has been processed.

    In addition: Because the Americas region is relatively large, when the zoom level corresponding to the drill level is set to automatic, the entire region is displayed by default, and the map will not automatically drill to the center point of the Americas. It is more appropriate to set it to 2 here.


    Attachment List


    Theme: Chart
    • Helpful
    • Not helpful
    • Only read

    Doc Feedback