The [nfgeo_mashup_map] is used to display a mashup map anywhere on the front-end of your site. You can set the map to display the locations added to all or to specific form entries.
The shortcode outputs the locations which are saved in the Geocoder field of the plugin. So you must have at least one ( you can have as many as you wish ) Geocoder field in your Ninja Form.
Listed below are the shortcode attributes available for use with the [nfgeo_mashup_map] shortcode:
- form_id ( required ) – the ID of the form which you would like to display its entries on the map.
- include_entries – entries ID, comma-separated, which you would like to include in the map ( by default, all entries will be included ).
- geocoders_keys – Geocoder fields keys, comma-separated, which you would like to include in the map. By default, all the Geocoder fields from the form will be included.
- map_height – set the map’s height ( ex. 200px, 100%, etc… ). Default value – 400px.
- map_width – set the map’s width ( ex. 200px, 100%, etc… ). Default value – 100%.
- map_type – set the map’s type. The available map types are roadmap, satellite, hybrid, and terrain. Default value – roadmap.
- entries_count – the maximum number of entries to display. Default value – 500.
- scrollwheel_zoom – whether to be able to zoom in/out the map using the mouse scroll-wheel or not. 1 to enable it, 0 to disable it.
- map_markers – set a custom map marker for each geocoder field. For each geocoder field pass the geocoder ID and the URL to the custom marker separated by “|” ( vertical bar ). You can pass multiple geocoder IDs comma-separated. For example, map_markers=”1|URL, 2|URL, 3|URL ). By default, the plugin will use the map marker set in the Geocoder field options.
- Basic usage of the shortcode to display the location from all the entries belongs to the form with ID 1 on the map.
- Display only entries with IDs 1, 2, and 3 on the map.
[nfgeo_mashup_map]nfgeo_mashup_map form_id="1" include_entries="1,2,3"]
- Display the locations belong to the geocoders with field IDs 1 and 2 only.
[nfgeo_mashup_map]nfgeo_mashup_map form_id="1" geocoders_id="1,2"]
- Use a custom map marker for the geocoders with field IDs 1 and 2.
[nfgeo_mashup_map]nfgeo_mashup_map form_id="1" map_markers="1|http://maps.google.com/mapfiles/ms/icons/red-dot.png, 2|http://maps.google.com/mapfiles/ms/icons/blue-dot.png"]