def __init(self):
        """ populates all the properties for the map service """

        params = {"f": "json"}
        json_dict = self._get(self._url, params,
                                 securityHandler=self._securityHandler,
                                 proxy_port=self._proxy_port,
                                 proxy_url=self._proxy_url)
        self._json = json.dumps(json_dict)
        self._json_dict = json_dict
        attributes = [attr for attr in dir(self)
                      if not attr.startswith('__') and \
                      not attr.startswith('_')]
        for k,v in json_dict.items():
            if k == "tables":
                self._tables = []
                for tbl in v:
                    url = self._url + "/%s" % tbl['id']
                    self._tables.append(
                        TableLayer(url,
                                   securityHandler=self._securityHandler,
                                   proxy_port=self._proxy_port,
                                   proxy_url=self._proxy_url)
                    )
            elif k == "layers":
                self._layers = []
                for lyr in v:
                    url = self._url + "/%s" % lyr['id']
                    layer_type = self._getLayerType(url)
                    if layer_type == "Feature Layer":
                        self._layers.append(
                            FeatureLayer(url,
                                         securityHandler=self._securityHandler,
                                         proxy_port=self._proxy_port,
                                         proxy_url=self._proxy_url)
                        )
                    elif layer_type == "Raster Layer":
                        self._layers.append(
                            RasterLayer(url,
                                        securityHandler=self._securityHandler,
                                        proxy_port=self._proxy_port,
                                        proxy_url=self._proxy_url)
                        )
                    elif layer_type == "Group Layer":
                        self._layers.append(
                            GroupLayer(url,
                                       securityHandler=self._securityHandler,
                                       proxy_port=self._proxy_port,
                                       proxy_url=self._proxy_url)
                        )
                    elif layer_type == "Schematics Layer":
                        self._layers.append(
                            SchematicsLayer(url,
                                            securityHandler=self._securityHandler,
                                            proxy_port=self._proxy_port,
                                            proxy_url=self._proxy_url)
                        )    
                    else:
                        print ('Type %s is not implemented' % layer_type)
            elif k in attributes:
                setattr(self, "_"+ k, json_dict[k])

            else:
                print (k, " is not implemented for mapservice.")
def __init ( self ) : params = { "f" : "json" } json_dict = self . _get ( self . _url , params , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) self . _json = json . dumps ( json_dict ) self . _json_dict = json_dict attributes = [ attr for attr in dir ( self ) if not attr . startswith ( '__' ) and not attr . startswith ( '_' ) ] for k , v in json_dict . items ( ) : if k == "tables" : self . _tables = [ ] for tbl in v : url = self . _url + "/%s" % tbl [ 'id' ] self . _tables . append ( TableLayer ( url , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) ) elif k == "layers" : self . _layers = [ ] for lyr in v : url = self . _url + "/%s" % lyr [ 'id' ] layer_type = self . _getLayerType ( url ) if layer_type == "Feature Layer" : self . _layers . append ( FeatureLayer ( url , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) ) elif layer_type == "Raster Layer" : self . _layers . append ( RasterLayer ( url , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) ) elif layer_type == "Group Layer" : self . _layers . append ( GroupLayer ( url , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) ) elif layer_type == "Schematics Layer" : self . _layers . append ( SchematicsLayer ( url , securityHandler = self . _securityHandler , proxy_port = self . _proxy_port , proxy_url = self . _proxy_url ) ) else : print ( 'Type %s is not implemented' % layer_type ) elif k in attributes : setattr ( self , "_" + k , json_dict [ k ] ) else : print ( k , " is not implemented for mapservice." )
populates all the properties for the map service