bobosch / ods_osm

TYPO3 Extension OpenStreetMap
10 stars 22 forks source link

Maps with OpenLayer 2 are only displayed after the zoom level has been changed #52

Closed claude27 closed 1 year ago

claude27 commented 4 years ago

Maps with OpenLayer are only displayed after the zoom level in frontend has been changed. (TYPO3 9.5.16, ods_osm dev version, programme: OpenLayers, main level: Mapnik, Zoom: 12)

albig commented 4 years ago

Haven't tried it yet. You mean OpenLayers (2) or OpenLayers3? I remember the first one is buggy.

claude27 commented 4 years ago

I mean OpenLayers (2).

albig commented 4 years ago

Actually my JavaScript skills are limited and OpenLayers 2 is quite old, too.

The development console in Chrome shows the following:

Uncaught TypeError: Cannot read property 'left' of null
    at initialize.getViewPortPxFromLonLat (OpenLayers.js?1581710385:254)
    at initialize.getViewPortPxFromLonLat (OpenLayers.js?1581710385:199)
    at initialize.getPixelFromLonLat (OpenLayers.js?1581710385:199)
    at initialize.getLayerPxFromLonLat (OpenLayers.js?1581710385:201)
    at initialize.draw (OpenLayers.js?1581710385:1003)
    at initialize.addPopup (OpenLayers.js?1581710385:179)
    at mapMarker (tx_odsosm_openlayers.js?1596195050:32)
    at HTMLDocument. (osm:99)

I think, this must be fixed in Resources/Public/tx_odsosm_openlayers.js. Maybe someone else knows to do it.

albig commented 2 years ago

Upcoming release 4.1.0 will have OpenLayers 7.1.0 and this issue can be closed.

albig commented 1 year ago

This is fixed in current master.