I'm trying to figure how to use GPS coordinates in OpenLayers
A lot of older posts are referring to new OpenLayers, well that isn't available in 3.4 where everything is embedded in ol.
I figured this should be doable by something like this
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.BingMaps({
key: '',
imagerySet: 'Aerial'
})
})
],
//projection: "EPSG:4326",
//displayProjection: "EPSG:3857",
view: new ol.View({
//center: [-13553864, 5918250],
center: new ol.geom.Point(ol.proj.transform([58.4108600, 15.6215700], 'EPSG:4326', 'EPSG:3857')),
zoom: 4
})
});
But no, it sais TypeError: undefined is not a function
It is the new ol.geom.Point(ol.proj.transform([58.4108600, 15.6215700], 'EPSG:4326', 'EPSG:3857')) that is causing all the trouble, this is where almost any example say "use var lonlat = new OpenLayers.LonLat..."
Thanks