Custom Google Map for a business
We will build this
You must need a google map api.
wp_enqueue_script( THEME_TEXTDOMAIN . '-googlemappolyfill', 'https://polyfill.io/v3/polyfill.min.js?features=default', null, false, true );
wp_enqueue_script( THEME_TEXTDOMAIN . '-googlemap', get_stylesheet_directory_uri() . '/assets/theme/js/googlemap.js', null, false, true );
wp_enqueue_script( THEME_TEXTDOMAIN . '-googlemapapi', 'https://maps.googleapis.com/maps/api/js?key=YOURGOOGLEMAPAPIKEYHERE&callback=initMap', null, false, true );
- Add
<div id="map"></div>
in your html file. - Write custom javscript code and add the path in your html file.
- Add
googlemapapikey
path andpollyfill.min.js
path in your html file. - I guess thats it!