def render_tile(self, lols, coord, format): buff = StringIO() if type(lols) is list: get_feature_layer = lambda l : self.get_feature_layer(l, coord, format) feature_layers = map(get_feature_layer, lols) merge(buff, feature_layers, coord, format) else: bounds = u._bounds(coord, lols.srid) features = self.get_features(lols, coord, bounds, format) encode(buff, lols.name, features, coord, bounds, format) return buff.getvalue()
def render_tile(self, lols, coord, format): buff = StringIO() if type(lols) is list: get_feature_layer = lambda l: self.get_feature_layer( l, coord, format) feature_layers = map(get_feature_layer, lols) merge(buff, feature_layers, coord, format) else: bounds = u._bounds(coord, lols.srid) features = self.get_features(lols, coord, bounds, format) encode(buff, lols.name, features, coord, bounds, format) return buff.getvalue()
def get_feature_layer(self, layer, coord, format): bounds = u._bounds(coord, layer.srid) features = self.get_features(layer, coord, bounds, format) return {'name': layer.name, 'features': features}