Closed sadiq-mc closed 8 years ago
Are you able to remote debug the device to see if there are any console errors? Do you see the message Cordova device ready event
?
If you aren't able to remote debug then you can place alerts in the code to act as breakpoints. Start by placing an alert statement before the require
and see if it gets triggered.
Yes.. the device ready event is printing in the console..
I did debugging by placing alerts before require
, inside require
and both displayed.. But the one I placed inside startGeolocation
function which is called once the map is loaded didn't fire.
You mentioned you can see the debug console, can you post a screenshot of all the console messages from when you first start the app until it stops loading?
After that, here are some other things to try:
1) Instead of listening for the load
event, you could try layer-add
.
2) Create a non-PhoneGap version of the app and debug it on Windows Desktop. Reference: http://stackoverflow.com/questions/14567491/windows-phone-8-ie10-javascript-debugging
3) Run the phone in debugger mode in Visual Studio and debug the app that way.
Got it..!! Thank you for your support..
Added the dojo
script tag and the map loaded successfully..
Windows:
Now stuck with an issue in graphicsUtils
.. Am plotting a few points in a loop and after that I get the extend using graphicsUtils.graphicsExtent(features)
to set the extent to include all the points in the extend... The map is failing here to and so the map is not displaying now.. :(
Once if I remove the extent code, the points are plotted and the map is displayed.
Android: Another scenario, In my hybrid app I have two languages supports, English & Arabic.. For English the map displays without any issue.. But when I switch the language to Arabic and load the map, it moves to right side of the screen.
For windows, verify that a valid Extent is being returned and that no errors are being thrown. If nothing is being returned and you aren't seeing any errors, you may need to place that code in a try/catch block.
On the Android issue, make sure you read the ArcGIS API for JavaScript localization doc. Here are some easy tweaks to try:
<div id="map" dir="ltr"></div>
<script type="text/javascript">
dojoConfig = {
locale: "ar",
parseOnLoad: true
};
</script>
Thank you.. The issue regarding the map moved to right was a css issue... I am placing a css class in <html>
tag.. Just updated this one and the problem was solved.. Thank you @andygup
Good deal, I'll go ahead and close this issue out then.
The
map.on("load", startGeolocation)
is not executing the function. Because of that the map is not getting displayed in the div. Once I pinch the screen, then the map displays.Am adding a point in the
startGeolocation
. As the map is not loaded completely, the point is also not displayed.Help me to fix it.