Javascript: Obtaining esri/map module on pages without a "new Map" ?

1570
0
10-14-2015 01:33 PM
CarlQuirion
New Contributor

Hello,

 

I'm currently building an application which hosts an esri webpage and provides communication with it.

All the communication is done using javascript and using the ArcGIS for Javascript API.

If the page contains a call to load the map (using dojo's require with "esri/map" as a module name) and the instance of the map is kept, i can work with it and do all i want.

However, some of the pages i would like to interface with don't have such an initializer or are not keeping the actual instance that is created there.

Is there a way for me to get the instance that is already initialized ? Kind of a dojo.resolve type of thing, if you will ? Or can i create a new instance of this object and have it communicate with the (already loaded) map?

 

I'm already adding script to the page's DOM to achieve a few of my goals, so i wouldn't mind adding code for it to work, i just can't change the way the map is initialized as it is not my code (but rather my client's).

Before anybody asks, yes i do have agreement from my client to push javascript in their page.

 

Thanks in advance

Tags (1)
0 Kudos
0 Replies