Esri / quickstart-map-phonegap

ArcGIS JavaScript samples for use with PhoneGap/Cordova
35 stars 37 forks source link

OnError event received for adding custom layer to map instance #12

Closed sadiq-mc closed 8 years ago

sadiq-mc commented 8 years ago

Hi, I can figure out why this onError is fired for loading a custom layer to map.. This happens intermittent. I am receiving "defineAlearyDefined" error and "MultipleDefine" error in console.. Can you please help me to solve this issue.

sadiq-mc commented 8 years ago

These are the errors displaying in the console

Error {src: "dojoLoader", info: 0} src: dojoLoader info: 0

Error {src: "dojoLoader", info: Object} src: dojoLoader info: Object {pid: "esri", mid: "esri/jsapi", pack: Object, url: "http://js.arcgis.com/3.14/esri/jsapi.js", executed: 5…} .

sadiq-mc commented 8 years ago

My require module looks like this..

require([ "esri/map", "esri/symbols/PictureMarkerSymbol", "esri/graphic", "esri/SpatialReference", "esri/geometry/Point", "esri/geometry/webMercatorUtils", "esri/InfoTemplate", "esri/lang", "esri/layers/ArcGISTiledMapServiceLayer", "esri/tasks/FeatureSet", "esri/graphicsUtils", "esri/tasks/RouteTask", "esri/tasks/RouteParameters", "esri/symbols/SimpleLineSymbol", "esri/Color", "esri/geometry/Circle", "esri/symbols/SimpleFillSymbol", "esri/layers/GraphicsLayer", "dojo/_base/connect", "dojo/on", "dojo/domReady!" ], function(Map, PictureMarkerSymbol, Graphic, SpatialReference, Point, webMercatorUtils, InfoTemplate, lang, ArcGISTiledMapServiceLayer, FeatureSet, graphicsUtils, RouteTask, RouteParameters, SimpleLineSymbol, Color, Circle, SimpleFillSymbol, GraphicsLayer, connect, on) { ........ }

andygup commented 8 years ago

Hi, are loading the require statement after the deviceready ready event? For an example check out the basicmap sample application

sadiq-mc commented 8 years ago

Yes... the page is loaded on button click after the index.html is ready..

On Mon, Mar 7, 2016 at 8:55 AM -0800, "Andy" notifications@github.com<mailto:notifications@github.com> wrote:

Hi, are loading the require statement after the deviceready ready event? For an example check out the basicmap sample applicationhttps://github.com/Esri/quickstart-map-phonegap/blob/master/scripts/basicmap.js

Reply to this email directly or view it on GitHubhttps://github.com/Esri/quickstart-map-phonegap/issues/12#issuecomment-193343217.

IMPORTANT NOTICE: This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version.

andygup commented 8 years ago

Do you have two define statements inside the custom layer?

Are you using Require.js?

Have you tried running this app as a stand-alone web application?

sadiq-mc commented 8 years ago

No... Also am not using require.js

I tried running your sample app as stand alone, and its working fine..

andygup commented 8 years ago

Have you tried running your custom app (not the sample app) as a stand-alone app?

sadiq-mc commented 8 years ago

I haven't tried that.. Let me check as a stand-alone app..

Can this cause due to some scripts in index.html..??

andygup commented 8 years ago

Testing your app as a stand-alone app has two benefits. It will help to identify issues with the life-cycle, and it removes PhoneGap from the equation.

andygup commented 8 years ago

Any luck on testing your custom app as a stand-alone app?

ghost commented 8 years ago

Sorry Andy, I couldn't able to test it as stand-alone app.. I will let you know once I get a chance to test it..

ghost commented 8 years ago

Thank you @andygup for your valuable support... I think this issue is resolved.. Am not receiving any error conditions now..

I think I had some issue with the data I was receiving from server to plot the location in the map...

You can close this issue now..