Tag Info

Hot answers tagged

8

They are functionally equivalent. The difference is that require() loads modules using AMD while your second example uses a class from a global variable populated by Dojo's module loader in legacy mode. Technically, you should have to use dojo.require("esri.geomtry.Point") for your second example to work but because the module that defines that class is ...


7

Checkout the utility functions in the esri.geometry namespace. You can do areas and lengths client side with functions from there. You can also do point-in-polygon client side with polygon.contains (also see extent.contains).


7

From the sounds of it you are trying to put down 1500 vector markers onto an OpenLayers map. Am I right? If this is the case then I would strongly suggest using some other method to display your vector features, as 1500 vectors in an OpenLayers map is a lot and will cause the browser to slow down and even crash altogether. The differences between browsers in ...


5

As far as I know, there's two problems in this code. First one is, both Query and QueryTask doesn't define outputSpatialreference parameters. So this query returns there own spatialreference geometries instead of map's spatialreference. tasks.Query... queryContentSelect.outSpatialReference = map.spatialReference; tasks.QueryTask... ...


5

The the head, you reference your files: <link rel="stylesheet" type="text/css" href="leaflet/leaflet.css" /> <!--[if lte IE 8]> <link rel="stylesheet" type="text/css" href="css/leaflet.ie.css" /> <![endif]--> <script src="leaflet/leaflet.js"></script> <script src="hydro_s.geojson" ...


5

You could listen for the "overlayadd" and/or the "overlayremove" events on the map object and have two separate legends (two controls) defined, e.g.: map.on('overlayadd', function (eventLayer) { // Switch to the Population legend... if (eventLayer.name === 'Population') { this.removeControl(populationChangeLegend); ...


5

You're going to have to use a Geometry Service to project features into anything other than the Web Mercator spatial reference. This sample show how to do a coordinate conversion using the service. The current projection tools within the API only do a geographic to/from Web Mercator projection.


4

The only solution pure javascript solution I've found so far (and I did not try) is https://github.com/thejefflarson/wkb.js. It's only an incomplete WKB parser (it converts WKB to a js object you can transform to WKT) An alternative way to wkb on javascript side can be the experimental twkb (not a standard at the moment) ...


4

I think you should extend your Layer with custom protocol option. var options_proj = { 'internalProjection': new OpenLayers.Projection("EPSG:3857"), 'externalProjection': new OpenLayers.Projection("EPSG:4326") }; new OpenLayers.Format.WKT({ protocol: new OpenLayers.Protocol.HTTP( { url: "kml path", format: new ...


4

You are approaching this backwards--the time slider's time extent updates the map's time extent, not the other way around. It's my understanding that the map.setTimeExtent() function should only be called when a time slider is not in use. You should be setting the extent of the time slider and setting the position of the time thumb(s), which then updates ...


4

First of all you have to activate your new key handler : keyHandler.activate(); You may also work a little on your callbacks. You will find a working example based on your code at the following URL : http://www.empreinte-urbaine.eu/mapping/ol_keyboard.html


4

There is the leaflet loading plugin https://github.com/ebrelsford/Leaflet.loading, it is straightforward to use. you could also look at the Spin plugin https://github.com/makinacorpus/Leaflet.Spin which is more customizable.


4

Here is how I solved it. L.tileLayer does accept bounds parameter. I found it by digging into the code, but it is currently missing from the documentation. This fixed it . L.tileLayer(config.ISLAND_IMAGERY + '/tile/{z}/{y}/{x}', { zIndex: -4, subdomains: ['', '1', '2'], bounds:[ new ...


4

Looking at your update, I feel that the only two solutions that you have are ESRI's JSAPI and esri-leaflet. Some might argue that OpenLayers would also be a possible solution, but in my experience, combining OpenLayers and ArcGIS services are a pain. If you go with ESRI's JSAPI, you need to understand that you are working with dojo. Once you understand ...


4

The BasemapToggle can only use basemaps from arcgis.com. I'll get the text on the page you referenced updated, it shouldn't say you can use your own custom basemaps. I apologize for the mistake. Edit: it is possible to use custom maps with the basemap toggle, but it takes a little work. First, load the default API config object and put info for your ...


4

If you want to ZoomTo a specific ZoomLevel , you can use Map.zoomTo like this: map.zoomTo(level); \\where level is an integer, indicating the zoom level If you just want to Zoom out one level, you can use Map.zoomOut like this: map.zoomOut()


4

I am not sure if I completely understand what your application is doing. Are you sending a query to postGIS every time the bbox changes and then render the response as a vector layer? If that's the case, in my experience, there are no obvious solutions to the problem. No magic bullets yet, but still solutions can be found, here some ideas: Maybe not what ...


4

Since your search region is circular, it is perhaps best not to consider it to be a polygon, but as a point with a radius and to use the ST_DWithin() function: ST_DWithin — Returns true if the geometries are within the specified distance of one another. It should save you and the processor a lot of effort.


4

I think that your are thinking it is more complex than you think! Try this: var popLocation= new L.LatLng(-42.8585,147.2468); var popup = L.popup() .setLatLng(popLocation) .setContent('<p>Hello world!<br />This is a nice popup.</p>') .openOn(map); Sourced from the excellent documentation. I know what you want to do now. ...


3

The symbol for your polygon from your query task is not valid. While it still works within the API, the print task is less tolerant. Change this: // Executes after the query ahs been completed dojo.connect(queryTask, "onComplete", function (results) { //QueryTask returns a featureSet. Loop through features in the featureSet avd add them to the map. ...


3

You can use this for creating dynamic colors var color; var r = Math.floor(Math.random() * 255); var g = Math.floor(Math.random() * 255); var b = Math.floor(Math.random() * 255); color= "rgb("+r+" ,"+g+","+ b+")"; then use this var firstpolyline = new L.Polyline(pointsSelection, { color: color, weight: 5, smoothFactor: 1 }); I think this ...


3

You should access it through http protocol. file protocol is not allowed with a WFS server. see this StackOverflow question. To test geoserver WFS try GetCapabilities request. For your case try this: http://localhost:8080/geoserver/wfs?service=wfs&version=1.1.0&request=GetCapabilities. More info at geoserver manual


3

You are specifying that the map should be loaded with the "hybrid" map type (in your l_Options object), which is is one of the available map services hosted at services.arcgisonline.com/ArcGIS/rest/services. In order to remove the dependency on ESRI services, you should not specify a basemap, and instead load your own layers from your own instance of ArcGIS ...


3

I think this is the very example you are looking for: http://openlayers.org/dev/examples/getfeatureinfo-control.html The example is using GeoServer, but the same applies for MapServer. You may just serve the data as WMS in MapServer, and on client side create a OpenLayers.Layer.WMS layers instead of OpenLayers.Layer.MapServer, then just do as the sample ...


3

But 'ZoomStatus' isn't even mentioned in the documentation According to http://trac.osgeo.org/openlayers/ticket/3629 it's scheduled for 2.13 (but the current dev version still doesn't feature it). The fact is that it does little more than call map.getZoom() anyway, so you're probably better off implementing a custom handler. Example: Go to ...


3

you must be having map div.put following code <div id="map"> <input id="Addlyr" type="submit" value = "Add Layer" style="position: absolute; z-index: 1000; left: 100px; float: right;" /> </div> if you want new button and put nice style adjust using css in style attribute of input button. If you are referring + and - button then ...


3

Yes, it is a security problem. A common solution is to go through a proxy- a service you write that your client can call that will in turn call the endpoint. Your client calls your service with all arguments except the token. The service copies all the arguments passed to it, adds the token, calls the endpoint, and returns the response to your client.


3

Yes. Everything is possible. But first consider if you actually need to write your own app, or you prefer just to use existing tools (see the comment under your answer). If you choose to use Google maps for georeferencing - then the question is: Is the image in a projection compatible with Mercator Projection EPSG:3857 (this is used by google maps)? Is ...


3

Over the past several years, there has been a movement of doing more things via Ajax, rather than doing things on the server side and posting an updated page back. The ESRI JavaScript API makes ample use of Ajax and the easiest thing for you would be to call a Javascript function on the click of your button. This Javascript function could call the required ...


3

What you are requiring sounds like Map Channels (v4) or MapFab It's Simple you sign up and load your data from Google Spreadsheets in and you can edit/filter data. This does not edit data directly with the map. http://www.mapchannels.com/MC4Demo.aspx If you want edit data directly on the map I suggest: MapFab http://www.mapfab.com/editor/new (both ...



Only top voted, non community-wiki answers of a minimum length are eligible