POST
|
Ok thank you for this answer. I will stop searching When doing property measurements two decimals is used 99% of the time, so we will change this when we switch to the 4.0 API.
... View more
12-04-2015
10:07 AM
|
0
|
0
|
348
|
POST
|
Hi, The Measurement dijit always displays a specific number of decimals for each unit, e.g. 1 decimal for meters, 2 decimals for kilometers, etc.. I can't figure out how to have more decimals displayed. I know from stepping into the Measurement dijit code that the measure has plenty of decimals, however they all get truncated at some point before being displayed. Thanks, Yohan
... View more
12-04-2015
09:05 AM
|
0
|
3
|
2827
|
POST
|
Ok I am going to be trying to implement this over the next few days. I appreciate all the help! Certainly learning a great deal through this forum. I will let you know how it goes ... Good luck with your app! -Eric Ok good luck too. Btw if you use this plugin know that it will disable any click event you may have registered with your map element ( e.g dojo.connect(map, "onClick", onMapClick); ) because it calls event.preventDefault() in the touchstart event handler. What I have done to fix this (for now) is comment that line out in jquery.fidget.beta.1.js and call event.preventDefault() myself in my pinch handler function.
function onMapPinch(event, fidget){
if (fidget.pinch.status == "end"){
switch(fidget.pinch.direction){
case "in": map.setLevel(map.getLevel() - 1); fidget.pinch.direction = "unknown"; break;
case "out": map.setLevel(map.getLevel() + 1); fidget.pinch.direction = "unknown"; break;
case "unknown": break;
}
}
else if (fidget.pinch.status == "move"){
event.preventDefault();
}
//$("#pinchStatus").html($("#pinchStatus").html() + fidget.pinch.status + ", ");
}
In other words, I want to make sure that if I detect a pinch then I don't want the map click handler to be called, but if the user does just tap the screen then it should be called. But anyway, still work in progress.
... View more
03-09-2012
06:41 AM
|
0
|
0
|
1187
|
POST
|
I would like to try and add the pinch and zoom to my app as well. I am not as experienced with building apps, but I have been able to work my way through some changes. Can you tell me where to add the code you posted for this and where the plugin code needs to go to achieve the pinch and zoom functionality? I am working with the "basic viewer" downloadable javascript template from arcgis online. I appreciate the help! ! -Eric Hi Eric, Well like I said in my previous post, this is pretty experimental code. I just got it working today and I'm still making adjustments and figuring things out as we speak. If you want to try too be my guest, but don't expect everything to work perfectly. Also note that I prefer using jQuery when possible. ESRI prefers using Dojo, so we have to use it too when doing certain things with the API. It's up to you what you want to use in your own project. Both can be used simultaneously too, it's all just JavaScript. So, basically you just download the fidget plugin from here http://www.simonboak.co.uk/fidget/ and put the jquery.fidget.beta.1.js file somewhere in your web project. Then in your index.html you include it after jQuery (the plugin extends it) by including the script the usual way. Here's my <head> right now, it should give you an idea:
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Title</title>
<script>
var dojoConfig = {
//Required if you have dojo widgets (aka.dijits) in your HTML markup
parseOnLoad: true
};
</script>
<!-- ArcGIS JSAPI 2.7, includes Dojo 1.6.1 and Dojo Widgets -->
<link href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.7/js/dojo/dijit/themes/claro/claro.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.7/js/esri/dijit/css/Popup.css"/>
<script src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.7" type="text/javascript"></script>
<!-- jQuery Mobile 1.1.0-RC1 and jQuery 1.7.1 -->
<link rel="stylesheet" href="jQuery/jquery.mobile-1.1.0-rc.1.min.css" />
<link rel="stylesheet" href="jQuery/jquery-mobile-custom.css" /> <!-- [YB 2012/02/29 We can use this file to modify the default css of jQuery Mobile] -->
<script src="jQuery/jquery-1.7.1.min.js"></script>
<!--<script src="jQuery/jQuery-mobile-custom.js"></script>--> <!-- [YB 2012/02/27 We can use this file to modify the global defaults of jQuery Mobile] -->
<script type="text/javascript"> <!-- [YB 2012/03/02 I tried putting this custom script in an external js file, but it doesn't work with PhoneGap, mobileinit is not fired. I can't figure out why right now] -->
// Edit jQuery Mobile global defaults
$(document).bind("mobileinit", function(){
// Make sure a back button is always available on all pages
$.mobile.page.prototype.options.addBackBtn=true;
$.mobile.page.prototype.options.backBtnText = "Précédent";
$.mobile.page.prototype.options.backBtnTheme = "a";
$.mobile.page.prototype.options.backBtnIcon = "back";
// 1.1.0-RC1 forces "fade" for page transitions on Android. This code puts back the "slide" transition.
// [YB 2012/03/02 : I've actually disabled all page transitions for now, to maximize performance. Might re-enable them later, if future jQueryMobile releases improves performance]
$.mobile.defaultPageTransition = "none";
$.mobile.transitionFallbacks.slide = "none";
// Disable any effect when displaying dialogs
$.mobile.defaultDialogTransition = "none";
// Disable tapToggle for headers and footers (DOESN'T WORK)
$("[data-role=header]").fixedtoolbar({ tapToggle: false });
$("[data-role=footer]").fixedtoolbar({ tapToggle: false });
});
</script>
<script src="jQuery/jquery.mobile-1.1.0-rc.1.min.js"></script>
<!-- Mobiscroll plugin - DatePicker widget for mobiles -->
<link href="plugins/mobiscroll/mobiscroll-1.5.3.min.css" rel="stylesheet" type="text/css" />
<script src="plugins/mobiscroll/mobiscroll-1.5.3.min.js" type="text/javascript"></script>
<!-- Fidget plugins for additional touch gestures (e.g. pinch) -->
<script src="plugins/fidget/jquery.fidget.beta.1.js" type="text/javascript"></script>
<!-- PhoneGap 1.4.1 -->
<script type="text/javascript" charset="utf-8" src="phonegap/phonegap-1.4.1.js"></script>
<!-- Our stuff -->
<link rel="stylesheet" href="index.css" />
<script type="text/javascript" charset="utf-8" src="extents.js"></script>
<script type="text/javascript" charset="utf-8" src="index.js"></script>
</head>
Then you can put the code in the jQuery ready function (in my case this is in my index.js file). The mapDiv element is the div used for your ESRI map object, so you're basically saying you want this handler to be called when the user pinches it. I just manually zoom by 1 right now, but there's most likely a better way to do this. Work in progress.
$(document).ready(function(){
$("#mapDiv").fidget({ pinch: function(event, fidget){
//var mapPoint = map.toMap(new esri.geometry.Point(event.x, event.y));
switch(fidget.pinch.direction){
case "in": map.setLevel(map.getLevel() - 1); fidget.pinch.direction = "unknown"; break;
case "out": map.setLevel(map.getLevel() + 1); fidget.pinch.direction = "unknown"; break;
//case "in": map.centerAndZoom(mapPoint, map.getLevel() - 1); break;
//case "out": map.centerAndZoom(mapPoint, map.getLevel() + 1); break;
case "unknown": break;
}
} });
});
... View more
03-06-2012
10:32 AM
|
0
|
0
|
1187
|
POST
|
Assuming the API does not handle some touch events for the map (still a mystery), I was able to manually add pinch zoom in/out in my webapp. The latest version of Jquery Mobile (1.1.0-RC1) does not support pinch touch events, but you can add them with a plugin, like Fidget. This is what I have for now:
$("#mapDiv").fidget({ pinch: function(event, fidget){
switch(fidget.pinch.direction){
case "in": map.setLevel(map.getLevel() - 1); break;
case "out": map.setLevel(map.getLevel() + 1); break;
case "unknown": break;
}
} })
It's still rudimentary of course, but I just wanted to prove you can use pinch gestures in hybrid mobile applications in this way. I still need to figure out how to center the map at the location of the pinch (instead of simply zooming), currently experimenting with the centerAndZoom method. Hopefully this can help someone trying to do something similar.
... View more
03-06-2012
06:39 AM
|
0
|
0
|
1187
|
POST
|
Ok let me rephrase my question. Does the map element of the ArcGIS API for JavaScript handle touch events (e.g. touchStart, touchEnd) in a way that multi-touch pinch zoom should be recognized and the map zoom automatically, or do I have to handle these touch events myself and manually zoom through the map zoom methods? Thanks
... View more
03-05-2012
04:52 AM
|
0
|
0
|
1187
|
POST
|
Hi, I'm currently making an hybrid webapp using jQueryMobile 1.1.0-RC1, PhoneGap 1.4.1 and the ArcGIS API 2.7 I'm not able to make zooming gestures work on my Samsung Galaxy Tab 10.1 with Android 3.2. Is this something that is documented not to be supported right now? If so, does anyone know if this is something that can be worked around using PhoneGap? Thanks
... View more
03-02-2012
11:50 AM
|
0
|
10
|
2786
|
POST
|
Thanks Derek for the info. Yes those Dojo links you provided are what I was looking at yesterday, what I realized this morning is that in the Dojo API documentation if you open something in the 1.7 api (say, BorderContainer) then switch to 1.6, it will never display the 1.6 documentation for BorderContainer until you close the previous BorderContainer tab first. This is what confused me, I'll let them know. Oh, and btw nice HTML5 presentation yesterday. Nice summary of the new features, and useful links you provided. Thanks
... View more
02-24-2012
03:30 AM
|
0
|
0
|
661
|
POST
|
Hi everyone. I am new to ArcGIS API for JavaScript and I just started a project yesterday. For the JavaScript framework I decided to give Dojo a shot instead of jQuery since the API seems to make heavy use of it. I have a question regarding the latest Dojo documentation (1.7) I was looking at, since I'm also new to Dojo. I know this new 2.7 API says it still uses Dojo 1.6.1. So I tried to look up the Dojo API references for 1.6 on the Dojo site but unless I'm mistaken it seems to present 1.7 syntax only regardless of the API number selected. I am wondering if I can use the new 1.7 syntax, is it completely different then 1.6.1? For example if I check the dijit.layout.BorderContainer reference, the syntax appears different then what I've seen for the Dojo example on the ArcGIS API for JavaScript documentation (for example dojoType v.s. data-dojo-type). Which one should I use/learn? Thanks
... View more
02-23-2012
11:35 AM
|
0
|
0
|
661
|
POST
|
Hey guys, I'm currently looking into creating a custom WMSLayer component which gives me more control over the specific request parameters I want to set, by extending DynamicMapServiceLayer as seen in this thread: http://forums.esri.com/Thread.asp?c=158&f=2421&t=296210 At the same time I want my custom component to be compatible with the ESRI map component, so that I can use it more or else the same way. So I'm trying to mimic the original WMSLayer properties too. It's currently working halfway, I can obtain maps from various WMS services if I specify the parameters I want, loadMapData() will properly trigger the GetMap WMS request, but I can't figure out how/where to trigger the GetCapabilities WMS request. I've already set skipGetCapabilities to false Do I simply need to manually make the request in my custom WMSLayer constructor? I believe this needs to happen before the overriden DynamicMapServiceLayer::loadMapData() function is called. I'd also like to implement the GetFeatureInfo request at some point. Any hints/tips for me? Thanks
... View more
06-15-2011
12:52 PM
|
0
|
1
|
1102
|
POST
|
Hi Aaron, I'm currently gathering information about how to use WFS in a Flex application. I saw the API for Flex does not seem to support it yet, and I was wondering if someone had done a custom WFSLayer component built on top of ESRI's FeatureLayer, or something similar that would allow a Flex application to easily make WFS requests on a MapServer offering WFS services. Yours seems to be an independent component. Can you use such a component to achieve everything the FeatureLayer would? For instance could I achieve the same things as the FeatureLayer samples? http://help.arcgis.com/en/webapi/flex/samples/index.html If so yes I find this very interesting, I would love to see a working version or short example of an application on how you use it. Hopefully ESRI will release a WFS component to make this as easy as their WMSLayer one, but until then I'm looking for alternatives. Thanks
... View more
06-10-2011
11:15 AM
|
0
|
0
|
688
|
POST
|
Thanks bjorn for your response, although after some debugging I realize now it's not an issue with the SDK. What I'm trying to do is put the sample in a separate library, which I could then include in all different Flex projects (i.e. AIR, FlashPlayer, mobile). To avoid repetition. I found that when I move everything out of the library, then everything will work fine. I think I can't include a SWC within a SWC. Yes I am kind of new to Flex so I apologize, I should have debugged more. As for why it worked with my FlashPlayer project, I just realized that if you don't do a clean build, Flash Builder will run your latest working SWF if you have errors with your current one.. After a clean, I was getting the same error in this project as well.
... View more
05-31-2011
08:09 AM
|
0
|
0
|
557
|
POST
|
I have an issue when trying to reproduce the WMS layers on/off sample for a Desktop application. The FlashPlayer version works fine but for the Desktop I always get this error: "Error: Skin for poc_desktop0.WindowedApplicationSkin2.Group3.contentGroup.HDividedBox7._poc_desktop_Map1.StaticLayer13.ScaleBar24 cannot be found." flex_sdk_4.5.0.17689 arcgis-api-for-flex-2.3.1 Flash Builder 4.5 Adobe Air 2.6.0.19140 I tried adding the arcgis-api-for-flex-2.3.1\skins\src folder as a source attachment for agslib-2.3.1-2011-04-26.swc in the "Flex Library Build Path" in Flash Builder, but it didn't help. Is this a 4.5 SDK issue or do I have to do something special for Air?
... View more
05-30-2011
11:26 AM
|
0
|
0
|
557
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|