<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6"></script>
esri.setRequestPreCallback(function (ioArgs) { alert(ioArgs.url); ioArgs.url = ioArgs.url.replace('http:', 'https:'); return ioArgs; });
Do you happen to have an example of that? This configuration isn't working for me:<snip>In Chrome I get: [blocked] The page at https://xyz/test2.html ran insecure content from http://www.arcgis.com/sharing/community/groups?q=title%3A%22ArcGIS%20Online%20Basemaps%22%20AND%20owner%3Aesri&f=json&callback=dojo.io.script.jsonp_dojoIoScript1._jsonpCallback.
<!DOCTYPE html> <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"/> </head> <body class="claro"> <div id="mapContainer" data-iconSet="Modern"> <div id="map" dojotype="dijit.layout.ContentPane" region="center" style="height: 950px;"> <div id="mapSelector"> <button id="dropdownButton" label="Basemaps" dojoType="dijit.form.DropDownButton"> <div dojoType="dijit.Menu" id="basemapMenu"> <!-- the menu items are dynamically created from basemaps --> </div> </button> </div> </div> </div> </body> <script type="text/javascript">var djConfig = { 'parseOnLoad': true };</script> <script type="text/javascript" src="https://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6"></script> <script type="text/javascript"> // setup arcgis dojo.require('esri.map'); dojo.require('dijit.form.Button'); dojo.require('dijit.layout.BorderContainer'); dojo.require('dijit.layout.ContentPane'); dojo.require('esri.dijit.BasemapGallery'); dojo.require('dijit.form.Button'); dojo.require('dijit.Menu'); var basemapGallery, _map; dojo.addOnLoad(function () { var initExtent = new esri.geometry.Extent({"xmin":-122.46,"ymin":37.73,"xmax":-122.36,"ymax":37.77,"spatialReference":{"wkid":4326}}); _map = new esri.Map("map",{ extent:esri.geometry.geographicToWebMercator(initExtent) }); basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps: true, map: _map }); dojo.connect(basemapGallery, 'onLoad', function () { dojo.forEach(basemapGallery.basemaps, function (basemap) { // add a menu item for each basemap, when the menu items are selected dijit.byId('basemapMenu').addChild(new dijit.MenuItem({ label: basemap.title, onClick: dojo.hitch(this, function () { basemapGallery.select(basemap.id); }) })); }); }); dojo.connect(_map, 'onLoad', function () { //resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', _map, _map.resize); }); }); </script> </html>
basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps: true, map: _map });
All the samples are using standard HTTP, but I figured using SSL would be as simple as adding an "s"
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=2.6"></script>And while it more or less was, I did have to apply the hack below: esri.setRequestPreCallback(function (ioArgs) { alert(ioArgs.url); ioArgs.url = ioArgs.url.replace('http:', 'https:'); return ioArgs; });Unfortunately even with that, all of the map images are being loaded over non-SSL. Is there a proper way to using ArcGIS over SSL? Some property I need to set somewhere?TIA!
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.