map is showing and files are enqueued and included the right way

This commit is contained in:
lenovo
2022-10-30 18:58:08 +01:00
parent 92cb24cb89
commit c35adaa732
9 changed files with 307 additions and 118 deletions

View File

@@ -21,7 +21,7 @@ function ink_menu_page() {
}
function ink_gm_setting(){
?>
<h2> Google Map </h2>
<h2>Google Map</h2>
<form action="" method="post">
<div class="ink_set">
<label>Latitude : </label>
@@ -56,25 +56,24 @@ function my_init_script() {
wp_enqueue_script('my_script', $script_path, array('jquery'));
$style_path = plugins_url('style.css', __FILE__);
wp_enqueue_style('my_style', $style_path);
console_log("urlencode : " . urlencode("128 rue de la croix nivert, paris"));
}
add_shortcode('googlemap', 'show_google_map');
function show_google_map() {
global $wpdb;
$GoogleMap_Latitude = get_option('googleMap_latitude_position');
$GoogleMap_Longitude = get_option('googleMap_longitude_position');
$GoogleMap_zoom = get_option('map_zoom_value');
//src="https://maps.googleapis.com/maps/api/geocode/json?address=paris&key=AIzaSyCvdGV2ssD4ov4a9CuIlQhoJyz5gWWiSvE
?>
<script
src="http://maps.googleapis.com/maps/api/js?&sensor=false?&key=AIzaSyCvdGV2ssD4ov4a9CuIlQhoJyz5gWWiSvE">
</script>
<div class="latitude"><?php echo $GoogleMap_Latitude; ?></div>
<div class="longitude" ><?php echo $GoogleMap_Longitude; ?></div>
<div class="zoom"><?php echo $GoogleMap_zoom; ?></div>
<div id="showmap"> </div>
<?php
return '
<script
src="https://maps.googleapis.com/maps/api/js?&sensor=false?&key=AIzaSyCvdGV2ssD4ov4a9CuIlQhoJyz5gWWiSvE">
</script>
<div class="latitude"><?php echo $GoogleMap_Latitude; ?></div>
<div class="longitude" ><?php echo $GoogleMap_Longitude; ?></div>
<div class="zoom"><?php echo $GoogleMap_zoom; ?></div>
<div id="showmap"> </div>
';
}
add_shortcode('googlemap', 'show_google_map');
?>