0

I have a subscribe function in angular 10. I am getting the console 'geom' before executing the subscribe. Please describe how to execute the next section ie, calling to zoomToGeometry() only after executing the subscribe?

hitself.gisService.getidDetails(hitself.id).subscribe((posts) => {
            console.warn(`gisService executed - ${hitself.id}`);

            const get_wkid = posts[0]['spatialReference'];
            hitself.wkid = get_wkid['wkid'];
            const dynamicrings = posts[0]['features'];
            hitself.dynamicRings = dynamicrings[0]['geometry']['rings'];
            const geom = new hitself.esriModules.geometry.Polygon({
              spatialReference: {
                wkid: hitself.wkid,
              },
              rings: hitself.dynamicRings,
            });
            console.warn(`geom ${hitself.dynamicRings}`);

            hitself.zoomToGeometry(geom);
          });
Adam-KER
  • 67
  • 9
  • 1
    Hi @adam-ker, how is that?, the handler of the subscribe only executes when an event happens .. can you add more code to see where could be the problem? – cabesuon Oct 15 '20 at 16:25
  • Hi Cabesuon, Let me explore the issues again and I can describe it with more clues. I think i need to check the 'subscribe' a bit more. Thanks for the response. – Adam-KER Oct 17 '20 at 08:26

0 Answers0