Saturday, November 25, 2017

Primefaces gmap

<h:head>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>


<p:gmap center="41.381542, 2.122893" zoom="15" type="HYBRID" style="width:100%;height:400px" />


https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/Debugging_JavaScript enable browser console:
about:config
devtools.chrome.enabled set it to true

then Ctrl-Shift-J (in firefox)


"Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error" js:38
"Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys" util.js:246
"Google Maps API warning: SensorNotRequired https://developers.google.com/maps/documentation/javascript/error-messages#sensor-not-required"


in reality one should provide a key

<script src="http://maps.google.com/maps/api/js?key=MY_API_KEY" type="text/javascript"></script>

https://developers.google.com/maps/documentation/javascript/get-api-key?utm_source=geoblog&utm_medium=social&utm_campaign=2016-geo-na-website-gmedia-blogs-us-blogPost&utm_content=TBC



No comments: