Skip to main content
欢迎参加 3 月 5 日至 6 日在旧金山举行的 TDX AI 代理时代开发者大会,或通过 Salesforce+ 参与。立即注册

Use a Bounding Box to Zoom In on Your Map

What’s a Bounding Box?

Now it's time to tune the awesome zip code map you created to get a better visualization. Ideally, you can zoom in on the areas for which you have data. Instead of a map that includes all of the geometry encoded in the GeoJSON, we want a map based on a subset of that geometry.

A bounding box redefines the area of the map to display by delimiting the boundaries of the new area using coordinates. The trick is figuring out the correct coordinates.

For the geographical map of zip code areas, the coordinates of every shape encoded in the GeoJSON are simply longitude and latitude coordinates. Finding the longitude and latitude of an area of the map that includes only the relevant area of the map requires a tool that can display those coordinates on the map itself.

There are many tools available on the Internet that can do this task for you. But we’ve already found the coordinates you need to zoom in on the zip codes with the data.

Create the New Map

You can create the new map from the same GeoJSON file you already uploaded.

  1. If you don’t already have it open, open the Los Angeles Tax Data by Zip Code dashboard and switch to edit mode.
  2. Select the map chart to view the widget properties.
  3. Expand the Map section, and then click Add Map button next to the Map Type property.
  4. In the left pane of the New Map page, select custom_map_project_geojson, the GeoJSON that you previously uploaded. Select the geoJSON file, boundaries, label, and projection type for the new map.
  5. In the Map Label field, enter Central L.A. Zipcodes.
  6. In the Projection Type field, select Equirectangular.
  7. In the center pane, drag the handles of the map to change the top, bottom, left, and right boundaries. As closely as possible, set top to 34.2, bottom to 33.85, left to -118.65, and right to -117.65. The boundaries are updated as you drag the handles in the map.
  8. Click Done. The map zooms in on central L.A., showing county data.
  9. Save the dashboard.
What a difference the bounding box makes! This useful map never existed in Analytics before you created it. With so many GeoJSON map definitions freely available on the web, there’s no limit to what geographical data you can visualize with Analytics.

验证步骤

+100 分

您将在您自己的实践组织中完成此项目。单击启动以开始,或单击您的组织的名称以选择不同的组织。

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈