0

I am trying to show dojo GFXLayer of dojox.geo.openklayers on my map layers , the problem is that my map is not showing townLayer but map is showing default OSM Layer and GFX layer.What I am Doing Wrong? My Code Is

var dojoMap = new Map("map");  
var map = dojoMap.getOLMap();  
var townLayer = new OpenLayers.Layer.WMS("Towns","http://"localhost":6666/geoserver/wms?",
   {layers: 'Layer:towns', format: 'image/png', transparent: true, info_format: 'text/html',
    gtype:'polygon'});  

map.addLayer(townLayer);  
var layer = new GfxLayer();  
var p = new Point({x:ny.longitude, y:ny.latitude});  
var f = new GeometryFeature(p);  
f.setFill([ 0, 128, 128 ]);  
f.setStroke([ 0, 0, 0 ]);  
f.setShapeProperties({r : 20});  
layer.addFeature(f);  
dojoMap.addLayer(layer);   

1 Answer 1

1

Should your code maybe be

dojoMap.addLayer(townLayer);

instead of

map.addLayer(townLayer);
1
  • thanks, but in my case that was projection issue
    – Ahmed
    Commented Apr 14, 2014 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.