het google map verdwijnt als ik html code in contact pagina verplaats en java script in footer of he

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Johannes davidian

johannes davidian

20/03/2017 20:05:53
Quote Anchor link
Hallo,
ik heb voor ieder pagina van my website eigen php pagina gemaakt om verschillende header images te gebruiken. nu ik probeer google map api in mij contact pagina te verplaatsen maar dingen gaat fout.
als ik het code op deze manier doen:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Garage
 */


?>


</div><!-- #content -->

<div id="map">  </div>
<script>
      function initMap() {

        // Create a new StyledMapType object, passing it an array of styles,
        // and the name to be displayed on the map type control.
        var styledMapType = new google.maps.StyledMapType(
            [
              {elementType: 'geometry', stylers: [{color: '#ebe3cd'}]},
              {elementType: 'labels.text.fill', stylers: [{color: '#523735'}]},
              {elementType: 'labels.text.stroke', stylers: [{color: '#f5f1e6'}]},
              {
                featureType: 'administrative',
                elementType: 'geometry.stroke',
                stylers: [{color: '#c9b2a6'}]
              },
              {
                featureType: 'administrative.land_parcel',
                elementType: 'geometry.stroke',
                stylers: [{color: '#dcd2be'}]
              },
              {
                featureType: 'administrative.land_parcel',
                elementType: 'labels.text.fill',
                stylers: [{color: '#ae9e90'}]
              },
              {
                featureType: 'landscape.natural',
                elementType: 'geometry',
                stylers: [{color: '#dfd2ae'}]
              },
              {
                featureType: 'poi',
                elementType: 'geometry',
                stylers: [{color: '#dfd2ae'}]
              },
              {
                featureType: 'poi',
                elementType: 'labels.text.fill',
                stylers: [{color: '#93817c'}]
              },
              {
                featureType: 'poi.park',
                elementType: 'geometry.fill',
                stylers: [{color: '#a5b076'}]
              },
              {
                featureType: 'poi.park',
                elementType: 'labels.text.fill',
                stylers: [{color: '#447530'}]
              },
              {
                featureType: 'road',
                elementType: 'geometry',
                stylers: [{color: '#f5f1e6'}]
              },
              {
                featureType: 'road.arterial',
                elementType: 'geometry',
                stylers: [{color: '#fdfcf8'}]
              },
              {
                featureType: 'road.highway',
                elementType: 'geometry',
                stylers: [{color: '#f8c967'}]
              },
              {
                featureType: 'road.highway',
                elementType: 'geometry.stroke',
                stylers: [{color: '#e9bc62'}]
              },
              {
                featureType: 'road.highway.controlled_access',
                elementType: 'geometry',
                stylers: [{color: '#e98d58'}]
              },
              {
                featureType: 'road.highway.controlled_access',
                elementType: 'geometry.stroke',
                stylers: [{color: '#db8555'}]
              },
              {
                featureType: 'road.local',
                elementType: 'labels.text.fill',
                stylers: [{color: '#806b63'}]
              },
              {
                featureType: 'transit.line',
                elementType: 'geometry',
                stylers: [{color: '#dfd2ae'}]
              },
              {
                featureType: 'transit.line',
                elementType: 'labels.text.fill',
                stylers: [{color: '#8f7d77'}]
              },
              {
                featureType: 'transit.line',
                elementType: 'labels.text.stroke',
                stylers: [{color: '#ebe3cd'}]
              },
              {
                featureType: 'transit.station',
                elementType: 'geometry',
                stylers: [{color: '#dfd2ae'}]
              },
              {
                featureType: 'water',
                elementType: 'geometry.fill',
                stylers: [{color: '#b9d3c2'}]
              },
              {
                featureType: 'water',
                elementType: 'labels.text.fill',
                stylers: [{color: '#92998d'}]
              }
            ],
            {name: 'Styled Map'});

        // Create a map object, and include the MapTypeId to add
        // to the map type control.
        var map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: 51.865, lng: .345},
          zoom: 11,
          mapTypeControlOptions: {
            mapTypeIds: ['roadmap', 'satellite', 'hybrid', 'terrain',
                    'styled_map']
          }
        });

        //Associate the styled map with the MapTypeId and set it to display.
        map.mapTypes.set('styled_map', styledMapType);
        map.setMapTypeId('styled_map');
      }
    </script>

<script async defer
    src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCcVLAHwD3F94QxDROJJP_R7Q50QXV4mI0&callback=initMap">
    </script>

 

 

    <div class="site-footer">          
                 <div class="expanded row">
                  <div class="site-footer-section1 small-4 column">Je krijgt altijd vooraf een</br>
 prijsopgave, dus geen verrassingen</br>
 achteraf.  </div> </div>
                  <div class="expanded row">
                  <div class="site-footer-section2 small-4 small-push-4 column">Gecertificeerde eerste monteur</br>
                                                                    Keurmeester(25 jaar ervaring)  </div> </div>
                       <div class="expanded row">
                             <div class="site-footer-section3 small-4 small-push-9 column"> David's Apk Station </br>
                                                                 Klompenmakerstraat 123</br>
                                                                  3194 DD Hoogvliet RT</br>
                                                                  010-2160660 </div> </div>
                    <div class="expanded row">
                  <div class="site-footer-section3C small-4 small-push-8 column">                                                              Email:[email protected]    </div> </div>        
           </div>


  </div>
                  
                
 
        <div class="site-info">
<div class="expanded row">
               <div class="site-info-section1 small-4 column"> <?php
echo do_shortcode('[smartslider3 slider=286]');
?>
</div>  </div>
<div class="expanded row">
                 <div class="site-info-section2 small-4 small-push-5 column">40 jaar vaak ervaring </div> </div>
<div class="expanded row">
        <div class="site-info-section3 small-4 small-push-9 column">BMW Specialist(25 jaar ervaring)</div> </div>    
            
        </div><!-- .site-info -->
                  
    
        







<script>
function _(id) { return document.getelementById(id) ; }
function submitform() {
         _("mybtn") .disabled = true;
         _("status") .innerHTML = 'please wait ...' ;
         var formdata = new FormData () ;
         formdata.append( "n", _("n") .value );
         formdata.append( "e", _("e") .value );
         formdata.append( "t", _("t") .value );
         formdata.append( "o", _("o") .value );
         formdata.append( "m", _("m") .value );
         var ajax =new XMLHttprequest () ;
         ajax.open( "POST", "example_parser.php" );
         ajax.onreadystatechange = function() {
              if (ajax.readyState == 4 && ajax.status == 200) {
                   if(ajax.responseText =="success") {
                      _("my_form") .innerHTML = '<h2>Thanks '+_("n") .value+', your message has been sent.</h2>';
          } else {
                _("status") .innerHTML =ajax.responseText;
                _("mybtn") .disabled =false;
                       }
            }
    }
      ajax.send( formdata );
}                  

</script>    
  
</div><!-- #page -->



<?php wp_footer(); ?>
 

</body>
</html>


dan u kunt zien op deze url:http://webdesignleren.net/contact/
dat de map is zichtbaar maar ik kan hem niet omhoog of onder contactform image krijgen omdat ik denk dat:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<div id="map"> </div>

is niet onder image classs is verplaatst in contact pagina.

maar als ik ID map code als volgende in contact.php verplaats:



Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?php
 /*
 Template Name: contact
 */

if(is_page(43)) {
 get_header('contact');
}

else {
 get_header();
}

 wp_head(); ?>

 <div class="expanded row">
 <div id="primary" class="content-area">
              <div class="expanded row">
        <main id="main" class="site-main">  

<div class="small-8 column">
<div class="expanded row">
<div class="contact-form-tekst small-4 column">Neem contact met ons op  </div> </div>


<div class="expanded row">

<div class="contact-form">    
<?php
$image_url
='http://webdesignleren.net/wp-content/uploads/2017/03/contact-form-background-800-600.jpg';
?>


<img src="<?php echo $image_url;?>">


<div class="expanded row">
<div class="contact-formT">Contactformulier</div> </div>
<div class="expanded row">
<div class="contact-formE small-12-column">    


<form id="my_form"   onsubmit="submitForm(); return false;">
<p><input id="n"  placeholder="Naam" required></p>
<p><input id="e"  placeholder="Email Address" type="email" required></p>
<p><input id="t"   placeholder="telefoon" ></p>
<p><input id="o"  placeholder="Onderwerp" required></p>
<textarea id="m"  placeholder="Uw bericht" rows="12" required></textarea>
<p><input id="mybtn"  type="submit" value="Submit Form"> <span id="status"></span></p>


</form>

</div></div>

</div></div>
<div class="expanded row">
<div class="google-map" id="map">  </div></div>

</div>


 
<div class="small-4 column">
<div class="expanded row">
<div class="aside1-header-tekst small-12 column">Adres en contactgegevens</div>  </div>

<div class="section-aside1">
<div class="expanded row">
<div class="subaside1 small-4 column">
<?php
echo do_shortcode('[smartslider3 slider=140]');
?>

</div>
<div class="subaside1-section2 small-8 column">
David's APK Station</br>
Klompenmakerstraat 123</br>
3194 DD Hoogvliet RT                            
  </div>
</div>
<div class="expanded row">
<div class="subaside2 small-2 column">
<?php
echo do_shortcode('[smartslider3 slider=141]');
?>


   </div>

<div class="subaside2-section2 small-8 small-pull-2 column">010-XXXXXX </div>
</div>
<div class="expanded row">
<div class="subaside3 small-2 column"><?php
echo do_shortcode('[smartslider3 slider=142]');
?>
  </div>
<div class="subaside3-section2 small-8 small-pull-2 column">>Plan route  </div>
</div>
<div class="expanded row">
<div class="subaside4 small-10 column">  </div>
</div>
<div class="expanded row">
<div class="subaside5 small-12 column">Openingstijden David's APK Station Hoogvliet</div>
</div>
<div class="expanded row">
<div class="subaside6 small-4 column">
<table>
<tbody>
<tr>
<td>
Maandag
Dinsdag
Woensdag
Donderdag
Vrijdag
Zaterdag
Zondag
</td>
</tr>
</tbody>
</table>


  </div>
<div class="subaside6-section2 small-6 small-pull-2 column">
<table>
<tbody>
<tr>
<td>08.00 - 18.00 uur
08.00 - 18.00 uur
08.00 - 18.00 uur
08.00 - 18.00 uur
08.00 - 18.00 uur
08.00 - 13.00 uur
Gesloten</td>
</tr>
</tbody>
</table>


 </div>
</div>
</div><!--  end van aside1 -->
<div class="expanded row">
<div class="aside2-header-tekst small-12 column">Klantboordeling</div>
</div>

<div class="section-aside2">
<div class="expanded row">
<div class="KB-section1 small-7 column"><?php
echo do_shortcode('[smartslider3 slider=145]');
?>
</div>
<div class="KB-section2 small-5 column"></div>
</div> </div>




<div class="expanded row">
<div class="aside4-header-tekst small-12 column">Facebook David's APK Station</div> </div>

<div class="section-aside4">
<div class="expanded row">
<div class="Facebook-section1 small-6 column"><?php
echo do_shortcode('[smartslider3 slider=146]');
?>
</div>
<div class="Facebook-section2 small-6 column">> Volg ons op Facebook</div>
</div> </div>

<div class="expanded row">
<div class="aside5-header-tekst small-12 column">Twitter David's APK Station</div>  </div>
<div class="section-aside5">
<div class="expanded row">
<div class="Twitter-section1 small-6 column"><?php
echo do_shortcode('[smartslider3 slider=147]');
?>
</div>
<div class="Twitter-section2 small-6 column">> Volg ons op Twitter</div>
</div>
</div>
</div>
</div>
</main>
</div>
</div> </div>
 
    

<?php get_template_part('template-parts/content',  'page' );
                          
                                                           ?>



 


 

 <?php
if( isset($_POST['n']) && isset($_POST['E']) && isset($_POST['t']) && isset($_POST['o']) && isset($_POST['M'] ) ) {
    
   $n = $_POST['n'];
   $e = $_POST['e'];
   $t =$_POST['t'];
   $o =$_POST['o'];
   $m =nl2br($_POST['m'] );
   $to ="[email protected]";
   $from = $e;
   $subject = 'Contact Form Message';
      $headers = "From: $from\n";
   $headers .="MIME-Version: 1.0\n";
   $headers .= "Content-type: text/html; charset=iso-8859-1\n";
  if(mail($to, $subject, $message, $headers)  ) {
       echo "success";
   }
else {
      echo "The server Failed to sent the message. Please try again later.";
  }
}

?>
            
 
<?php
if(is_page(43)) {
 get_footer('contact');
}

else {
 get_footer();
}


wp_footer(); ?>


dan verdwijnt google map van contact pagina. ik begrijp niet waarom?
ik werk met foundation grid system ,ik heb van alles geprobeerd om de probleem oplossen maar zonder resultaat.
eigenlijk hoort deze code:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<div id="map">  </div>

in contact pagina te zijn onder contact form class.
wat ik doe fout ?

ik heb alles volgens documentation van google gemaakt met API key en lang ING nummers.

dank u wel
johannes
Gewijzigd op 20/03/2017 21:52:12 door Johannes davidian
 
PHP hulp

PHP hulp

22/12/2024 12:38:47
 
- Ariën  -
Beheerder

- Ariën -

20/03/2017 20:12:39
Quote Anchor link
Als je de PHP-tags netjes afsluit ( ?>) zijn de code-blokken ook beter leesbaarder. Misschien handig om er op te letten, zodat het topic leesbaar blijft. Ik weet het dat het een bug is.
Gewijzigd op 20/03/2017 20:13:38 door - Ariën -
 
Johannes davidian

johannes davidian

20/03/2017 20:16:29
Quote Anchor link
dank u wel ,
wat kan het bug zijn? en hoe ik kan het oplossen?
johannes
 
- Ariën  -
Beheerder

- Ariën -

20/03/2017 20:24:22
Quote Anchor link
Als je de PHP-tags in je code netjes afsluit, is het code-blok ook netjes te zien op het forum. Nu staat je vraag in het codeblok. Dus niet zo goed leesbaar ;-). (regel 217)
En ja, dit is een foutje van deze site, die op termijn wel opgelost wordt, maar toch kan het geen kwaad om zelf even je post te controleren.
Gewijzigd op 20/03/2017 20:26:23 door - Ariën -
 
Johannes davidian

johannes davidian

20/03/2017 20:37:47
Quote Anchor link
ik heb geprobeerd om te corrigeren
ik weet het niet of het is nu alles in orde.
dank u wel
johannes
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.