Why doesn't this example work? http://dev.openlayers.org/releases/OpenLayers-2.12/examples/fusiontables.html I would like to do something similar but i can not find any other example how to display points from Google Fusion Table on the OpenLayers map?
1 Answer
The error message on console is:
Access Not Configured.
Please use Google Developers Console to activate the API for your project.
At bottom of example page on openlayers.org posted in question you can see this text:
View the fusiontables.js source to see how this is done.
You will need to get your own apikey from Google's API Console for this to
function on your domain.
Please see this link to setup Google's API Console
EDIT: An example post request
https://www.googleapis.com/fusiontables/v1/query?sql=%22select+*+from+1g5DrXcdotCiO_yffkdW0zhuJk0a1i80SPvERHI8%22&key={YOUR_API_KEY}
The above from Google API console gives:
{
"kind": "fusiontables#sqlresponse",
"columns": [
"Route",
"Reverse",
"Times Flown",
"Line String",
"DepAirport",
"ArrAirport",
"First Time",
"Last Time",
"Distance",
"Time",
"Route Airline List",
"Route Year List"
],
"rows": [
[
"CLT-MSP",
"",
"2",
{
"geometry": {
"type": "LineString",
"coordinates": [
[
-80.943139,
35.214,
0
],
[
-81.2867027228329,
35.5424123906216,
0
],
[
-81.6334656409202,
35.8701977680468,
0
.....
..
And Openlayers can take it from here.
-
I'm a little bit lost. I have a code as follows:
layers: [ new OpenLayers.Layer.OSM(), new OpenLayers.Layer.Vector("Vectors", { projection: new OpenLayers.Projection("EPSG:4326"), strategies: [new OpenLayers.Strategy.Fixed()], protocol: new OpenLayers.Protocol.Script({ url: "https://www.google.com/fusiontables/api/query", params: {sql: "select * from 1g5DrXcdotCiO_yffkdW0zhuJk0a1i80SPvERHI8"}, format: new OpenLayers.Format.GeoJSON({...
and where do I put my own apikey from Google's API Console– bucekJun 10, 2014 at 14:18 -
-
Did you registered on Google's API console? and first try the example hosted on openlayers– rkmJun 10, 2014 at 14:48
-
-