ACF Geography Field
Use Mapster to help build custom post types with geographic information stored appropriately and usable with the rest of the Mapster plugin.
Last updated
Was this helpful?
Use Mapster to help build custom post types with geographic information stored appropriately and usable with the rest of the Mapster plugin.
Last updated
Was this helpful?
If you want to use Mapster to store geographic information, or even attach geographic information to your own custom post types and then display them using the Mapster plugin, you can do that!
First, you have to install (the free version is fine). Once you do, if you are creating your custom fields, just look for the Mapster Map field type.
This will create a geographic editing field just like the one you see in the Mapster plugin:
You must select a single Geography Type (Point, Line, or Polygon).
If you don't select Styling, then that means you will just be storing geographic information. When getting this information out from ACF using ACF functions, the information will be stored as a GeoJSON. Just parse it as an object and you will be able to load it into any normal GIS system or other map.
If you do select Styling, then you'll be able to set all the options in the same way you can set them in the equivalent Mapster post type (Point, Line, or Polygon). This creates a ton of freedom to style your geographies wherever you want.
If you also want to customize Popups this way, just turn the Popups option on as well.
Once you've created your custom geographies on your custom post types, you can add them to any map you've created with Mapster. Open your map, then go to the Points, Lines, Polygons tab. There, scroll down and you will see a field for Add Custom Posts. Here, select the specific posts from your custom post type that you want to add, and presto! They will appear on your map.