Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit ce80ce6

Browse files
committed
Catch an OpenLayer error.
1 parent a25863a commit ce80ce6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

core/src/plugins/editor.openlayer/class.OLViewer.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,12 @@ Class.create("OLViewer", AbstractEditor, {
298298
var offset = new OpenLayers.Pixel(0, -size.h);
299299
var icon = new OpenLayers.Icon('plugins/editor.openlayer/services.png',size,offset);
300300
markers.addMarker(new OpenLayers.Marker(projectedCenter,icon));
301-
302-
map.setCenter(projectedCenter, 10);
303-
}
301+
try{
302+
map.setCenter(projectedCenter, 10);
303+
}catch(e){
304+
if(console) console.error(e);
305+
}
306+
}
304307
return {MAP: map, LAYERS:layers};
305308
},
306309

0 commit comments

Comments
 (0)