CMB2 Roadway Segments
This plugin adds a new CMB2 fieldtype for drawing roadway segments onto a map and provides a shortcode for display.
This plugin extends CMB2 by adding a new fieldtype called 'snapmap' that allows the user to highlight segments of roadway using Google's snap-to-road API. It also allows the user to drop a map pin in the same field. This data can then be displayed on the front-end using the
This plugin requires CMB2 and a Google Maps API key.
The Google Maps API key must have access to the following APIs:
- Google Maps Roads API
- Google Places API Web Service
- Allows developers to integrate Google Maps with Wordpress via CMB2.
- Allows site admins to provide custom maps styles and specify which map controls to include on the front-end.
- Provides an option to exclude the Google Maps JS API if already loaded.
Visit the wiki for documentation about adding the field to CMB2 and displaying maps on your site.
- Plugin settings.
- The CMB2 field.
- Front-end display via shortcode.
- Upload the
cmb2-roadway-segmentsfolder to the
- Activate the plugin through the 'Plugins' menu in WordPress
- Add a snapmap field to a CMB2 metabox.
[snapmap]anywhere in a post's content to render a map.
Frequently Asked Questions
Does this plugin support custom map markers?
Yes, but only by using the template tag.
Can I display a map of all map markers?
Also yes, but only by using the template tag.
Added the ability to enable the terrain overlay for maps generated by the snapmap_build_single() function.
- Added support for including retina map markers when using the snapmap_build_single() function. This is accomplished by including $marker['scaledSize']
- Added a field to paste raw geojson type / coordinate data into (under the Tools panel below the map). If the data type is LineString, pasted data will automatically be converted into a Google Maps compatiable JSON array and overwrite the polyline (Roadway Segment) field value. This functionality will be extended to other geometry types for the 0.9.7 release.
- Added fallbacks for tooltips. When being used for a single post, the title of the post containing the pin is displayed in the tooltip. When using queries, the post title followed by a link to the post is displayed.
- Added the ability to draw polygons on the map when the "limit_drawing" argument is not set. As a result, the geometry library is now required.
- Modified circle stroke and fill lables to reflect the inclusion of polygons.
- Fixed missing fill and stoke variables in output functions.
- Fixed a bug that prevented polylines, polygons, and circles from being rendered on query-based maps.
- Added the ability to draw circles on the map when the "limit_drawing" argument is not set
- Added fields to specify circle stroke and fill colors to the plugin's settings page
- Fixed invalid use of array keys in the shortcode function
- Added new 'disable_snap' field argument. When used, the snapToRoads API will not be called when drawing polylines
- Wrapped conditionals using the limit_drawing array key with isset() to ensure that the editor correctly renders
- Fixed invalid use of array keys
- Initial release.