Gmap problem

UI Components for JSF
Post Reply
paleman
Posts: 12
Joined: 02 Dec 2015, 21:32

22 Apr 2018, 18:38

Hello I have been reading the documentation about gmap in primefaces, I put according the documentation:

Code: Select all

<script src="https://maps.googleapis.com/maps/api/js? key=YOUR_API_KEY&callback=initMap" async defer></script>
I replace YOUR_API_KEY by my google api key and remove the space between ? and key

and

Code: Select all

<p:gmap center="41.381542, 2.122893" zoom="15" type="hybrid" style="width:600px;height:400px" />
but when I rendered the page there was an error: The reference to entity "callback" must end with the ';' delimiter.
So I search on google I replace & by &amp; the line was

Code: Select all

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;callback=initMap" async defer></script>
then I have the error Attribute name "async" associated with an element type "script" must be followed by the ' = ' character.

reading on google I replace

Code: Select all

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;callback=initMap" async="async" defer></script>
then I have the error Attribute name "defer" associated with an element type "script" must be followed by the ' = ' character.

reading on google I replace

Code: Select all

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

then I have this errors:
ReferenceError: google is not defined
uncaught exception: InvalidValueError: initMap is not a function

What I am doing wrong?

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

24 Apr 2018, 14:23

Where in the documentation did you read this? And what version of the documentation? And what version are you using?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 66 guests