Download & Extend

Add baselayers first

Project:OpenLayers
Version:7.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Pol
Status:closed (fixed)

Issue Summary

In some cases a baselayer needs to be available before other layers or controls can be added. For example adding a vector layer with strategy "Fixed" requires a baselayer. Can we add baselayers first or is there another way to solve this problem?

Comments

#1

The attached patch moves all baselayers to the top before adding them to the map.

AttachmentSizeStatusTest resultOperations
openlayers-add_baselayers_first-1817400-1.patch712 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 238 pass(es).View details

#2

Status:active» needs review

#3

This seems to work just fine, and solves the issue with #1387908: MapProjection is null error on initial fetching of kml layer.

A change in 2.11 (documented here: http://trac.osgeo.org/openlayers/ticket/3647) seems to require this change.

I'd prefer someone else more familiar with OpenLayers to RTBC this though.

#4

Assigned to:Anonymous» Pol

#5

In the long run the "Fixed" strategy should be fixed directly in OpenLayers. I'll prepare a pull request on GitHub ASAP, but in the meantime we need to fix this here.

#6

Status:needs review» fixed

Nice patch, committed !

Thanks !!

#7

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.