Can someone advice me how to convert or upgrade an old openlayers OSM map code?

I set up a couple of web sites several years ago that visualize survey data on clickable maps. Example:

I put a lot of effort into coding at the time and have not developed the sites further since they have continued to “do the job”. The code in the simplest form was:

<!DOCTYPE HTML>
<title>OpenLayers Simplest Example</title>
<div id="demoMap" style="height:250px"></div>
<script src="ol/ol.js" type="text/javascript"></script>
<script>
    map = new OpenLayers.Map("demoMap");
    map.addLayer(new OpenLayers.Layer.OSM());
    map.zoomToMaxExtent();
</script>

and I have had the css- and js-files in the ol folder on the web server. After this summer all maps are down, with the errors:

  1. Failed to load resource: net::ERR_NAME_NOT_RESOLVED polyfill.min.js:1
  2. Uncaught SyntaxError: Unexpected token ';'
  3. Uncaught ReferenceError: init is not defined at onload

The lines at the “unexpected token” look like this:

while ($row = mysqli_fetch_row($result_poi)) {
        $rows[] = $row;
}

The error message “init is not defined” signals that the the old and basic ol code no longer works. That code looks like this:

    function init() {
        var map = new ol.Map({
            target: 'map',
            layers: [
                new ol.layer.Tile({
                    source: new ol.source.OSM()
                })
            ],
            controls: ol.control.defaults({
                zoom: true,
                attribution: false,
                rotate: true
            })
        });

I understand that polyfill is a compromised link and have removed it. I also understand there have been new openlayer versions since I developed my web sites, and I am certain the new versions are much better than the old one. However, the old one was very sufficient, and whilst trying to upgrade to the new version I am not even managing to get the “Simple Map” to work. I have downloaded the v10.0.0-package and unzipped the files into the ol-folder on the host, but this does not seem to work (it complains about "Uncaught TypeError: Failed to resolve module specifier "rbush". Relative references must start with either "/", "./", or "../"). I changed all of the links in the main.js file so they pointed to the correct path, but I cannot find rbush anywhere. The quick start seems to tell me how to setup a local server with openlayers, but I’m using a host server and cannot install or configure the host.

I would really like to either get my existing code to keep working, OR adjust it to the new openlayer version. But I just don’t seem to understand the new way of using openlayers. Are my web maps lost for ever, or does someone have a solution that does not require me to relearn and recode everything? I would really appreciate some advice before messing up something that could work with minor adjustments.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật