My goal is to load several shapefiles and display them using OpenLayers 3 as the basemap. I now have these shapefiles as a Web Feature Service (WFS) on ArcGIS Online. Below is what I have done (starting with one WFS).
// arcgis start
var geojsonFormat = new ol.format.GeoJSON();
var vectorSource = new ol.source.Vector({
loader: function(extent, resolution, projection) {
var url = '// https://dservices1.arcgis.com/DbPykcCwUUYq5zKg/arcgis/services/urban/WFSServer?service=wfs&request=getcapabilities';
$.ajax({url: url, dataType: 'jsonp', jsonp: true});
},
strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({
maxZoom: 19
}))
});
window.loadFeatures = function(response) {
vectorSource.addFeatures(geojsonFormat.readFeatures(response));
};
var centerlocations = new ol.layer.Vector({
source: vectorSource,
style: new ol.style.Style()
});
// arcgis end
My browser console shows ol.tilegrid.createXYZ is not a function
. How do I go about successfully loading my shapefiles?