Select to view content in your preferred language

adding multiple feature layer

7251
10
Jump to solution
11-21-2012 04:38 AM
EricLussier
Occasional Contributor
Hi,

I would like to know if it is possible to add mant feature layers in the arcgis javascript api?

When my web apps intitialize, I can add a feature layer, but I have not been able to add a second one.

Thanks.
0 Kudos
10 Replies
__Rich_
Deactivated User
Hi Rich,

It is because the web app is made using MVC.

The topic is use in the bootstrapper to publish the event and then you register to the event in the business logic module.

Not to familiar with all this, but this is how the contoller look like. Thanks


[HTML]require(["dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane","dijit/layout/AccordionContainer",
    "my/map","dojo/aspect","dijit/registry","dojo/_base/connect", "dojo/topic", "dojo/domReady!"],
    function(parser, borderContainer, contentPane, accordion, map, aspect,registry,connect,topic)
    {
        parser.parse();
  var _map = addMapModule();

 
     function addMapModule() {
            var _map = new map('mapDiv');
            _map.initialize();
            return _map;
        };

    connect.connect(_map.map, 'onZoomEnd', function () {         
                topic.publish('zoom/end');
       }); 
    });[/HTML]

Yep, whoever wrote that code is connecting to the map's onZoomEnd event then re-publishing it as a topic i.e. it's not in the out-the-box API class.  (FWIW that code's not MVC-dependent/specific it's just some JS)

Glad you're up and running 🙂
0 Kudos