开发者 |
codeinwp
intergeomaps hardeepasrani themeisle Madalin_ThemeIsle uriahs-victor contactashish13 |
---|---|
更新时间 | 2019年11月14日 16:28 |
PHP版本: | 3.5 及以上 |
WordPress版本: | 5.3 |
版权: | GPL v2.0 or later |
版权网址: | 版权信息 |
[intergeo]Your address[/intergeo]
This shortcode will be displayed as Google Maps centered at specific address. The shortcode could be extended with custom attributes like height, width, zoom, etc. These attributes will setup special settings for a map.
The following table describes all possible attributes, which users can use with shortcodes:
Width
Sets width of the map container. Accepts all valid CSS values as css width property accepts. For example, the value could be set in pixels like 500px, or in percentage like 75%. Default value is 100%.
Height
Sets width of the map container. Accepts all valid CSS values as css height property accepts. For example, the value could be set in pixels like 700px. Default value is 300px.
Style
This attribute allows users to set extra styles for Google map's container element. It accepts all valid css properties and will echo it in the style attribute of the container element. Default value is empty.
Zoom
Sets the initial zoom level of the map. This attribute accepts integer value from 0 to 19, where 0 is the biggest distance and 19 is the lowest distance to the ground. The default value is 5.
Hook
This attribute allows users to setup their own filter, which will be used to filter settings of a map before using it to render a map. Hooks for the filter will receive one parameter which will be array of options and they have to return it modified or not.
So your shortcode could looks like this one:
[intergeo zoom="12" width="50%" height="400px" style="border: 3px solid red; margin: 0 auto;"]Central Park, NY[/intergeo]
Check-out the #1 free Google Maps plugin
Create map with UI builder
Another way to create map is to use UI builder. This is more recommended way to build a Google map as this way provides much more features and wide range of settings to customize. To create a map with UI builder, pass following steps:
/wp-content/plugins/intergeo/
directory.To override Google map settings you can use your own hook. Just add hook attribute to your shortcode like this:
[intergeo hook="my_custom_intergeo_hook" ...]...[/intergeo]
And add a function to hook that filter:
`add_filter( 'my_custom_intergeo_hook', 'filter_intergeo_map_settings' ) {
function filter_intergeo_map_settings( $options ) {
// update options
$options[...] = ...;
...
// return updated options
return $options;
}`