POST
|
bump. anyone? The sample I used for the JSfiddle is from one of Kelly's posts demonstrating the use of normal popups, that I changed to mobile popups... So I guess it is supposed to work like this. BR Paul
... View more
06-09-2012
02:22 AM
|
0
|
0
|
283
|
POST
|
added a JSFiddle to illustrate my issue better: http://jsfiddle.net/blauorange/NS3GD/ Thank you! Paul
... View more
05-31-2012
01:48 AM
|
0
|
0
|
283
|
POST
|
Hello! I've problems with the mobile popup in connection with graphics: it only shows the title without the (>)-Button to the description. [ATTACH=CONFIG]14748[/ATTACH] That's the function I use to add the graphics: function addLocation(lon,lat,desc,date,address,field1){ //create a point form the input lat/long var point = new esri.geometry.Point(lon,lat, new esri.SpatialReference(4326)); //associate the info with the graphics as attributes var attributes = { 'Address':address, 'Field1': field1, 'Description':desc }; //define an info template so a popup window with the point details appears when you click point var infoTemplate = new esri.InfoTemplate('${Field1}','${*}'); //define a symbol and add point to map var locationSymbol = new esri.symbol.PictureMarkerSymbol({ "angle":0, "xoffset":0, "yoffset":10, "type":"esriPMS", "url":"http://static.arcgis.com/images/Symbols/Shapes/BluePin1LargeB.png", "contentType":"image/png", "width":24, "height":24 }); //convert the point from geographics coords to web mercator since map is in web mercator var webMercatorGeometry = esri.geometry.geographicToWebMercator(point); var graphic = new esri.Graphic(webMercatorGeometry,locationSymbol,attributes,infoTemplate); map.graphics.add(graphic); map.centerAndZoom(webMercatorGeometry,12); } Any Ideas? BR Paul
... View more
05-30-2012
05:05 AM
|
0
|
3
|
645
|
POST
|
ah ok, that explains a lot 😉 I'd need the zoom functionality for a mobile webapp (iOS), so it should zoom right on the click of the button. Like the built-in zoom-buttons in this sample: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/mobile/mobile_simplemap.html
... View more
12-14-2011
11:06 AM
|
0
|
0
|
412
|
POST
|
Thanks Kelly, that would be exactly what I need. I tried to add it to my project but it didn't work. Also when trying to zoom in/out using the buttons in the demo you posted nothing happens... (I tested it with firefox, chrome and safari) BR Paul
... View more
12-14-2011
08:17 AM
|
0
|
0
|
412
|
POST
|
Hello! I'm using a basemap gallery with three maps (two static, one dynamic) in a mobile webapp. How can I build custom zoom buttons? I tried to find out what methods the built in buttons are using, without success and I also couldn't find anything in the API Reference... BR Paul
... View more
12-13-2011
11:54 AM
|
0
|
6
|
860
|
POST
|
I reproduced the issue with modifying the Measurement Example of the JavaScript API Samples (as found here: http://help.arcgis.com/en/webapi/javascript/arcgis/demos/widget/widget_measurement.html) All I did was adding two buttons, one to destroy the measurement dijit and one to create and start it up again. As you can see, the functionality of the dijit is there when recreating it (first hit off then on), but the div is not showing up. I call it a bug until someone proves me wrong 😉
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9" />
<!--The viewport meta tag is used to improve the presentation and behavior of the samples
on iOS devices-->
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>
Measure Tool
</title>
<link rel="stylesheet" type="text/css" href="http://serverapi.arcgisonline.com/jsapi/arcgis/2.5/js/dojo/dijit/themes/claro/claro.css">
<style type="text/css">
html,body {
height:100%;
width:100%;
margin:0;
}
body {
background-color:#FFF;
overflow:hidden;
font-family:"Trebuchet MS";
}
#map {
border:solid 2px #808775;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
margin:5px;
padding:0px;
}
#titlePane{
width:240px;
}
.claro .dijitTitlePaneTitle {
background: #808775;
font-weight:600;
border:solid 1px #29201A;
}
.claro .dijitTitlePaneTitleHover {
background:#808775;
}
.claro .dijitTitlePaneTitleActive {
background:#808775;
}
.claro .dijitTitlePaneContentOuter {
border-right: solid 2px #808775 !important;
border-bottom: solid 2px #808775 !important;
border-left: solid 2px #808775 !important;
}
</style>
<script type="text/javascript">
djConfig = {
parseOnLoad:true
};
</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.5"></script>
<script type="text/javascript">
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.TitlePane");
dojo.require("dijit.form.CheckBox");
dojo.require("esri.map");
dojo.require("esri.dijit.Measurement");
dojo.require("esri.SnappingManager");
dojo.require("esri.dijit.Scalebar");
dojo.require("esri.layers.FeatureLayer");
var map;
var measurement;
function init() {
//This sample may require a proxy page to handle communications with the ArcGIS Server services. You will need to
//replace the url below with the location of a proxy on your machine. See the 'Using the proxy page' help topic
//for details on setting up a proxy page.
esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";
esri.config.defaults.io.alwaysUseProxy = false;
//This service is for development and testing purposes only. We recommend that you create your own geometry service for use within your applications
esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
var initialExtent = new esri.geometry.Extent({"xmin":-9545482,"ymin":4615382,"xmax":-9544248,"ymax":4616059,"spatialReference":{"wkid":102100}});
map = new esri.Map("map", {
extent:initialExtent
});
dojo.connect(map, 'onLoad', function(map) {
//resize the map when the browser resizes
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer");
map.addLayer(basemap);
var sfs = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID,
new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID,
new dojo.Color([195,176,23]), 2),null);
var parcelsLayer = new esri.layers.FeatureLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/0", {
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
parcelsLayer.setRenderer(new esri.renderer.SimpleRenderer(sfs));
dojo.connect(map, "onLayersAddResult", function(results){
//dojo.keys.copyKey maps to CTRL on windows and Cmd on Mac.
var snapManager = map.enableSnapping({snapKey:dojo.keys.copyKey});
var layerInfos = [{layer: parcelsLayer}];
snapManager.setLayerInfos(layerInfos);
measurement = new esri.dijit.Measurement({
map: map
}, dojo.byId('measurementDiv'));
measurement.startup();
measurement.setTool("distance", true);
});
map.addLayers([parcelsLayer]);
}
//show map on load
dojo.addOnLoad(init);
function tglMeasurementOff() {
measurement.destroy();
}
function tglMeasurementOn() {
measurement = new esri.dijit.Measurement({
map: map
}, dojo.byId('measurementDiv'));
measurement.startup();
measurement.setTool("distance", true);
}
</script>
</head>
<body class="claro">
<div id="mainWindow" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:'false'"
style="width:100%; height:100%;">
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">
<button id="tglMeasurementOff" type="button" onclick="tglMeasurementOff();">toggleMeasurementOff</button>
<button id="tglMeasurementOn" type="button" onclick="tglMeasurementOn();">toggleMeasurementOn</button>
<div style="position:absolute; right:20px; top:10px; z-Index:999;">
<div id="titlePane" data-dojo-type="dijit.TitlePane" data-dojo-props="title:'Measurement', closable:'false', open:'false'">
<div id="measurementDiv"></div>
<span style="font-size:smaller;padding:5px 5px;">Press <b>CTRL</b> to enable snapping.</span>
</div>
</div>
</div>
</div>
</body>
</html>
... View more
10-25-2011
11:03 AM
|
0
|
0
|
521
|
POST
|
Hello! I have an issue with toggling the measurement widget: the first time i start the measurement it shows up and works correctly. Also destroying it works. But when I want to activate it another time the Div won't be displayed. What am I doing wrong?
var measurement;
...
if ((++clickcounter%2) == 0) {
measurement.destroy();
} else {
if (measurement == undefined) {
measurement = new esri.dijit.Measurement({
map: map,
defaultAreaUnit: esri.Units.SQUARE_METERS,
defaultLengthUnit: esri.Units.KILOMETERS
}, dojo.byId('measurementDiv'));
measurement.startup();
}
measurement.setTool("distance", true);
}
...
<div id = "measurementDiv"></div>
... View more
10-23-2011
06:00 AM
|
0
|
4
|
4603
|
POST
|
thanks a lot! the projectGeometries call seems to work now (the simulator connects to sampleserver3) but after that the following methods are not called.
- (void)geometryServiceTask:(AGSGeometryServiceTask *)geometryServiceTask operation:(NSOperation *)op didReturnProjectedGeometries:(NSArray *)projectedGeometries
{
NSLog(@"didReturnProjectedGeometries");
}
- (void)geometryServiceTask:(AGSGeometryServiceTask *)geometryServiceTask operation:(NSOperation*)op didFailProjectWithError:(NSError *)error {
NSLog(@"didFailProjectWithError");
}
Is there again something I forgot? I used the GeometryServiceSample as a basis and triple checked already if something's missing... BR, Paul
... View more
11-09-2010
09:15 AM
|
0
|
0
|
624
|
POST
|
Divesh, thanks for your reply. I tried to use the AGSGeometryServiceTask to project the point based on the GeometryServiceSample. [self.gst projectGeometries:self.geometryArray:outSR]; When building I get the following warning: 'AGSGeometryServiceTask' may not respond to '-projectGeometries::' which makes the application crash with the following output: -[AGSGeometryServiceTask projectGeometries::]: unrecognized selector sent to instance 0x727a140 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[AGSGeometryServiceTask projectGeometries::]: unrecognized selector sent to instance 0x727a140' After checking the AGSGeometryServiceTask.h I found that "projectGeometries" is actually missing: AGSGeometryServiceTask.h Can you tell what I'm doing wrong? BR, Paul
... View more
11-07-2010
02:34 AM
|
0
|
0
|
624
|
POST
|
Hi technobrat, I'm facing the same problem (my adressCandidate returns with spatialReference = Null) when using the Locator from http://tasks.arcgisonline.com/ArcGIS/rest/services/Locators/TA_Address_EU/GeocodeServer I'd need to project it to WKID 31259... Any tip?
AGSSpatialReference* outSR = [AGSSpatialReference spatialReferenceWithWKID:31259 WKT:nil];
[self.locator locationsForAddress:addresses returnFields:outFields outSpatialReference:outSR]; The log-output for the returned candidate: Candidate : AGSPoint: x = 15.441723, y = 47.067916, spatial reference: [(null)] BR, Paul
... View more
11-05-2010
02:51 AM
|
0
|
0
|
624
|
POST
|
Hello! I tried to add the code suggested by Jeremy but mapViewDidLoad is never called.
#pragma mark AGSMapViewDelegate
//called when the map view is loaded (after the view is loaded)
- (void)mapViewDidLoad:(AGSMapView *)mapView {
NSLog(@"mapView is loaded");
[mapView.gps start];
if (!mapView.gps.enabled) {
NSLog(@"The GPS is not enabled");
}
else if (mapView.gps.enabled) {
NSLog(@"The GPS is enabled");
}
} If I add the following code to viewDidLoad, it tells me that GPS is not enabled (in the simulator). When I run the official MapViewDemo it works though...
[self.mapView.gps start];
if (!self.mapView.gps.enabled) {
NSLog(@"The GPS is not enabled");
}
else if (self.mapView.gps.enabled) {
NSLog(@"The GPS is enabled");
}
My MapServer uses EPSG:31259 as the spatial reference. Does the mapView take care of the transformation from WGS84? Paul
... View more
09-15-2010
01:55 PM
|
0
|
0
|
460
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|