Geo Location fields

I haven’t been able to find any information about storing geolocation / geographic location / geojson data natively in Builder.io. I have content that I want to have geotagged so that it can be displayed on our website in a map. I’d rather avoid having to ask my content team to go to another site/tool to look up latitude/longitude that I then have them copy/paste or enter into number fields.

What are you trying to accomplish
I’d like to build a website that includes geographic location data tagged content, so that I can show the content in a map interface. I’d like to enter the geolocation data in the CMS using a visual map interface for my content editors to select the appropriate location, and then store the data in a structured data format (e.g. geoJSON, or even a structured object with attributes for lat/lon).

Code stack you are integrating Builder with
Astro.build static site

Hi @housser, Welcome to Builder.io Forum!

Localization and personalization are typically handled with custom targeting. There are several paths to localizing your content depending on your use case and you can check out our new localization docs here to get started!

For more details on setting up custom targeting attributes take a look at this doc: Using Custom Targeting - Builder.io

Hence, using a particular location attribute or value you can fetch builder content accordingly.

Hi garima,

Thanks for the note, but I think you are confusing localization with location. I’m interested in adding latitude/longitude attributes to my content, so that entities can be displayed using a map.

For example, here’s how Sanity supports that, with a Geopoint field type: Geopoint
NetlifyCMS has a Map widget: Widgets | Netlify CMS | Open-Source Content Management System
Drupal has a Location module: Location | Drupal.org

I hope that helps fill in a bit more context.

John

Hey @housser, thanks for your patience on this!

You can fetch content built on the builder on the basis of latitude/longitude attributes using Using Custom Targeting - Builder.io. Also if you need documentation about targeting features as well: Targeting Content in Builder - Builder.io

Perhaps it will help if I illustrate my situation with a use case.

I am building a marketing website for a local coffee shop, that has multiple locations. I want to have a page on my site that uses a map to show the locations of all the shops (Google Map, Leaflet, etc.).

I want to have a content model that represents one shop. That content model needs to have some way to store the shop’s location data. Rather than storing the street address and having to geo-code it when I want to display it on a map, I want to store the actual latitude/longitude of the shop.

The problem here is how do I attach the geolocation data of my entities, to my content models. I could just put the latitude into a Number field, but that would require my content editors to manually geocode the location and find, then copy-paste, the latitude from some other mapping tool.

I’d rather provide my content editors with a mapping interface where they could click on the map to indicate the location of the shop, then the CMS would capture the latitude and longitude and store them in a conventional geospatial data format in the CMS (like GeoJSON).

So again, this is not a question about localization or personalization, it’s a question about storing content entity specific location data in the content model fields.

John

Hey, @housser Thanks for the further illustration on this. Unfortunately, We don’t have this feature currently but you can submit a feature request here https://ideas.builder.io. As a workaround, you can do is create a custom field of type number for the coordinates and input them manually.