Is there an https implementation of the MapServer? We are using ESRI hosted map server and geometry functions to draw on rendered maps. We would like to be able to retrieve via https so as not to get security warnings on client systems. Is this possible?
Using https is dependent on the server hosting the map services, not the map services themselves. You can use ArcGIS Online services (and the JS API via https), here's an example I put together a while back: https://servicesbeta.esri.com/demos/https/basemap-gallery.html
Yes, we're using ArcGisOnline, specifically ArcGISTiledMapService. I think they were successful in getting the maps to render but the geometry tasks (drawing circles & lines) were not. I'll have a look at your example. Thank you.
ArcGIS Online is a web app that provides services (basemaps, geometry, geocoding, routing) while ArcGISTiledMapServiceLayer is a class in the API. The former is set up with use https/SSL while the latter uses whatever you give it (it's up to you to specify a service that uses SSL).
For the geometry operations, if you're drawing shapes, that's all done client side and https isn't part of the equation. Did I misunderstand what you're doing?
Sorry, it's been a few months since I worked on this. Code snippets below. If I understand correctly we should be able to simply replace all the http: with https:, correct?
map = new esri.Map("map"); var layer = new esri.layers.ArcGISTiledMapServiceLayer("http://server.arcg isonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); map.addLayer(layer); map.setExtent(esri.geometry.geographicToWebMercator(new esri.geometry.Exte nt(xMin, yMin, xMax, yMax, new esri.SpatialReference({wkid: 4326})))); gsvc = new esri.tasks.GeometryService("http://sampleserver3.arcgisonline.c om/ArcGIS/rest/services/Geometry/GeometryServer"); dojo.connect(map, "onLoad", doAll); function doAll() { drawLine(Xref,Yref,Xloc,Yloc); var x = Xloc; var y = Yloc; var dist = <%=radius%>; color = RED; drawCircle(x,y,dist,color); x = Xref; y = Yref; color = BLUE; dist = <%=refRadius%>; drawCircle(x,y,dist,color); } function drawLine(x1,y1,x2,y2) { var p1 = new esri.geometry.Point(x1, y1, new esri.SpatialReference({wkid:4 326})); var p2 = new esri.geometry.Point(x2, y2, new esri.SpatialReference({wkid:4 326})); var geographicGeometry = new esri.geometry.Polyline(new esri.SpatialRefere nce({wkid:4326})); geographicGeometry = geographicGeometry.addPath([p1,p2]); var mapGeometry = esri.geometry.geographicToWebMercator(geographicGeometry ); var symbol = new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol .STYLE_SOLID, new dojo.Color([255, 0, 0]), 3); var graphic = new esri.Graphic(mapGeometry ,symbol); map.graphics.add(graphic); }
function drawCircle(x,y,dist) { var params = new esri.tasks.BufferParameters(); var myPoint = new esri.geometry.Point(x, y, new esri.SpatialReference({wki d: 4326}) ); params.geometries = [ myPoint ]; params.distances = [ dist ]; params.unit = esri.tasks.GeometryService.UNIT_KILOMETER; params.outSpatialReference = map.spatialReference; gsvc.buffer(params, showBuffer); }