I have been trying to import the layer that I created in GeoServer. I need to use OpenLayers. This is what I have so far.

<!-- language: js -->

<script type="text/javascript">
var serviceUrl = 'https://gis.arlingtonva.us:6443/arcgis/rest/services/public/Bike_Routes/MapServer/';
var layer = '0';
var otherURL = 'Specialty/ESRI_StateCityHighway_USA/MapServer';

var raster = new ol.layer.Tile({
      source: new ol.source.OSM()

var map = new ol.Map({
  target: 'map',
  layers: [raster],
  view: new ol.View({
    center: ol.proj.fromLonLat([-77.0910, 38.8816]),
    zoom: 13.58

var bikes = new OpenLayers.Layer.WMS(
 "Bike Routes of Arlington", "http://localhost:8080/geoserver/ArlingtonBikePath",
         srs: 'EPSG:2283',
         layers: 'Bike_Route',
         styles: '',

map.addControl(new OpenLayers.Control.LayerSwitcher());
var myswitch = new OpenLayers.Control.LayerSwitcher(); 

  • 2
    Welcome to GIS SE. As a new user, please be sure to take the brief tour to learn about this site's focused Q&A format. Then please edit your question to include information about your expected output and where you are having trouble (including the exact text of any error messages).
    – Andy
    Apr 18 '19 at 19:46
  • Related information: gis.stackexchange.com/questions/237237/…
    – Mapperz
    Apr 18 '19 at 20:56
  • 1
    what happens? what doesn't happen? what does the console say? what does the GeoServer log say?
    – Ian Turton
    Apr 19 '19 at 7:20
  • thanks for looking into it. When I refreshed even the map is gone now. I tried with the gis.stackexchange.com/questions/237237/… – Mapperz♦ 23 hours ago
    – Alex
    Apr 19 '19 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.