so my question is how to use "mobile_geolocaterenderer" source code with my map
dojo.addOnLoad(init);
dojo.connect(map, "onLoad", initFunc);
In the snippet below, we check to see if browser supports geolocation, if it does we use the getCurrentPosition and watchPosition functions. The getCurrentPosition function retrieves the users current location and watchPosition tracks the users position as it changes. Both functions have the same structure, a success callback, error callback and a PositionOptions object
navigator.geolocation.getCurrentPosition(zoomToLocation, locationError);
Hi Tim,I'm still not sure what you're actually trying to do.It looks like you're using a Dynamic layer, so perhaps you could start by modifying the Dynamic Map sample.Your code uses:var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://locahost/arcgis/rest/services/landscape/grass_mapping/MapServer"); map.addLayer(layer);Have you verified that http://locahost/arcgis/rest/services/landscape/grass_mapping/MapServer is valid - does it appear in a similar manner to the sample service http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer ?
var layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://locahost/arcgis/rest/services/landscape/grass_mapping/MapServer"); map.addLayer(layer);
Hi Tim,Welcome to the JS forum. Can you be clearer about what you're trying to do? Are you trying to replace the ocean basemap with another basemap? Exactly which part of your code is failing?If you open up http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer in a web browser you'll see the REST endpoint, containing information about that service. What happens when you try your own server - do you see the same type of information?The Ocean_Basemap service is cached (Note that it says "Single Fused Map Cache: true"), which is necessary to display a tiled layer. See http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/arcgistiledmapservicelayer.htm for more info.Steve
I found this and wanted to try however have not much idea of JShttp://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/exp_geolocate.htmlso, I thought changing url for map location from http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServerto http://myserver/arcgis/rest/services/folder/webmap/MapServer" but did not work.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.