[OSGeoLive] #2163: openlayers_quickstart fails

OSGeoLive trac_osgeolive at osgeo.org
Tue Jul 30 08:55:07 PDT 2019


#2163: openlayers_quickstart fails
-----------------------+---------------------------
 Reporter:  darkblueb  |      Owner:  osgeolive@…
     Type:  defect     |     Status:  new
 Priority:  normal     |  Milestone:  OSGeoLive13.0
Component:  OSGeoLive  |   Keywords:  openlayers
-----------------------+---------------------------
 {{{
 The script from “http://localhost/openlayers/dist/ol-debug.js” was loaded
 even though its MIME type (“text/html”) is not a valid JavaScript MIME
 type.

 Loading failed for the <script> with source
 “http://localhost/openlayers/dist/ol-debug.js”.
 }}}

 after creating **basic-map** example file

 {{{

 <!DOCTYPE html>
 <html lang="en">
     <head>
         <title>Basic map</title>
         <meta charset="UTF-8">
         <meta name="viewport" content="width=device-width">

         <!-- OpenLayers CSS -->
         <link rel="stylesheet"
 href="http://localhost/openlayers/dist/ol.css" type="text/css">

         <!-- Custom styles -->
         <style>
           #map {
             width: 100%;
             height: 500px;
           }
         </style>
     </head>
     <body>
         <h1>Basic map</h1>

         <div id="map"></div>

         <!-- OpenLayers JS-->
         <script src="http://localhost/openlayers/dist/ol-debug.js"
 type="text/javascript"></script>

         <!-- App code -->
         <script>
           var map = new ol.Map({
             target: 'map',
             layers: [
               new ol.layer.Tile({
                 source: new ol.source.OSM()
               })
             ],
             view: new ol.View({
               center: ol.proj.fromLonLat([2.1833, 41.3833]),
               zoom: 6
             })
           });
         </script>

     </body>
 </html>


 }}}

-- 
Ticket URL: <https://trac.osgeo.org/osgeolive/ticket/2163>
OSGeoLive <http://live.osgeo.org/>
self-contained bootable DVD, USB thumb drive or Virtual Machine based on Lubuntu, that allows you to try a wide variety of open source geospatial software without installing anything.


More information about the osgeolive mailing list