Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have created a map in MBTiles using TileMill and hosted it on MapBox. Now I am trying to display it on my website adding the infobox using OpenLayers and Wax

Acording with these

http://www.mapbox.com/wax/connector-ol.html

http://support.mapbox.com/discussions/tilemill/44-displaying-legend-on-client-using-openlayers-and-wax

geoconsulter. de/map/wax/manual/index.html

This code should be working, but it does not. The tiles appear fine, but not the legend. If I do not comment this line //map.addControl(new wax.ol.Interaction()); there is an error about the method being undefined. But if I leave like that, there is no error but still the legend does not appear

wax.tilejson('http://api.tiles.mapbox.com/v3/carmencampos.example.jsonp',
function(tilejson) {
var map = new OpenLayers.Map({
div: 'map',
controls: [
    new OpenLayers.Control.Navigation(),
    new OpenLayers.Control.Attribution(),
    new wax.ol.Legend()
],
layers: [
    wax.ol.connector(tilejson)
]
});

map.addControl(new wax.ol.Legend());
//map.addControl(new wax.ol.Interaction());
map.zoomTo(3);
});

I would appreciate any comments.

Thanks in advance, Carmen

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.