I have read that, since Google Maps V3, developers do not need any api key in order to use google map api. My code is the following (the simplest one to visualize a google map). I have tried to run it both on google chrome and on firefox, but in both of them, the map popped up a few seconds and then the app raised this exception:
js?sensor=false:32 Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error_.ab @ js?sensor=false:32
util.js:208 Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys
The code is the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<f:view>
<h:head>
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
</h:head>
<h:body>
Map:
<p:gmap center="41.381542, 2.122893" zoom="15" type="HYBRID" style="width:600px;height:400px" />
</h:body>
</f:view>
</html>
In the documentation of primefaces there's no attribute for tag p:gmap in which insert api keys: