mapkitJS和ArcGIS esri-loader的Dojo MultipleDefine错误 [英] dojo multipleDefine error with mapkitJS and ArcGIS esri-loader

查看:68
本文介绍了mapkitJS和ArcGIS esri-loader的Dojo MultipleDefine错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道 MapkitJS esri-loader 在哪里出现问题.通过在这里和其他地方进行研究,似乎可能与另一个软件包存在命名冲突.这是 esri-loader <的已解决问题的

解决方案

如果研究这些多重定义,通常会有另一个库创建问题,常见的答案是在这些库之后加载ArcGis脚本或使用dojo加载库

我意识到,这里的问题是当您制作Mapkit地图时,它会加载更多脚本.因此,加载mapkit API会加载脚本,然后创建mapkit映射会加载更多脚本.因此,我要做的是加载mapkit API.创建地图,然后销毁它,然后加载ArcGis API.之后就可以了.

当前的问题是弄清楚何时完成创建Map的所有调用,它没有方法或侦听器告诉您何时完成.

I cannot figure out where MapkitJS and esri-loader are having issues together. From researching on here and elsewhere, it seems like there is likely a naming conflict with another package. Here is a link of the resolved issue for esri-loader. I read all the pages on that link.

I have a site that uses both MapkitJs and ArcGIS. Mapkit has always worked fine until I brought in ArcGIS. Both scripts are lazy loaded via a provider. After reading about the issues, I wait until Mapkit is initialized before loading the ArcGIS script.

The first thing I noticed was the ability to rotate maps in Mapkit immediately went away (it loads, then takes it away after about 1/2 second). That was my first hint something is conflicting.

If I remove esri-loader's call loadModules, which loads the script, the rotate works again. If I add it again (even if I don't specify any modules to add), it break Mapkit rotate.

Here is the main problem. If I create a mapkit map first, then try to create an ArcGIS map, it pops the error. But if I create an ArcGIS map first, and then the mapkit second, it's fine (except the apple mapkit map can't rotate).

I wish I could provide more information, but I don't even know where to start on this one. Please ask me what you need...

I uploaded a demo page to my site. If you go to https://dieselplanning.com/ it'll start with an Esri map loaded first. It works, you can switch maps (bottom left button in the sidebar). You'll also see the compass rose at the bottom right flash for a second on apple maps as it accepts rotation then decides not to shortly after creation.

However, if you go to https://dieselplanning.com/test it's the same exact page as the ao page, but it creates a mapkit map first. That will create issues when you swap maps.

解决方案

If you research these multiple defines there is normally another library creating the issue and the common answers are to load the ArcGis script after those libraries or load the libraries with dojo.

The problem here, I realized, is when you make a Mapkit map, it loads more scripts. So loading the mapkit API loads scripts, then creating a mapkit map loads more scripts. So what I have to do is load the mapkit API. Create a map, then destroy it, then load the ArcGis API. It works after that.

The current problem now is figuring out when the create Map is done making all its calls, it has no method or listener to tell you when that is done.

这篇关于mapkitJS和ArcGIS esri-loader的Dojo MultipleDefine错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆