Skip to content

Commit

Permalink
fix for #170
Browse files Browse the repository at this point in the history
  • Loading branch information
rduivenvoorde committed Jun 10, 2015
1 parent 252b1a3 commit 70c3d0a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions api/js/pdok-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,13 @@ Pdok.Api = function(config, callback) {
this.bbox = Pdok.bbox;

this.baselayers = Pdok.baselayers || [];

/**
* The actual ID of the baselayer to use (one out of 'baselayers' params)
* @type {null|*|string}
*/
this.baselayer = Pdok.baselayer || null;

/**
* A commaseparated list of pdok id's (defined in pdok-layers.js). Eg: 'brt,top10'
* @type String
Expand Down Expand Up @@ -861,6 +868,15 @@ Pdok.Api.prototype.createOlMap = function() {
});
olMap.addLayer(this.locationLayer);

// apply Baselayer if applicable
if (this.baselayer != null) {
var baselayerbyid = olMap.getLayersBy('pdokid', this.baselayer);
if(baselayerbyid.length > 0)
{
olMap.setBaseLayer(baselayerbyid[0]);
}
}

if (typeof this.features === 'object' || typeof this.features === 'string') {
// meaning we received a features string (kml) from the outside
// features string handled, this.features now used as feature array
Expand Down

0 comments on commit 70c3d0a

Please sign in to comment.