Hot answers tagged

4

No, this isn't possible. For one, if you were to load both API's, you would end up with a namespace collision with Dojo's Define and Require. For two, the API is obfuscated (not human readable) making it difficult to extract just the parts you need. Even if you could, there may be dependencies in that module preventing you from using it with an older API.


3

I can confirm that, as you've reported, this appears to be a real bug in both 0.7x and 1.0x (on Chrome, at least; I haven't tested it elsewhere). However, there is a workaround that seems to prevent it. If you name your click event listener function, you can turn it off on dragstart, then use setTimeout to turn it back on a short time after dragend: ...


2

You need to extrude polygons: entity.polygon.extrudedHeight = entity.properties.your_height_field You may need to loop over records, for example: var p = dataSource.entities.values; for (var i = 0; i < p.length; i++) { p.polygon.extrudedHeight = entity.properties.your_height_field


2

This blog has an excellent example of how to make the window draggable and hide the arrow using dojo: https://gavinr.com/2015/04/13/arcgis-javascript-draggable-infowindow Here's the key javascript snippet: require([ 'esri/arcgis/utils', 'dojo/dnd/Moveable', 'dojo/query', 'dojo/on', 'dojo/dom-class' ], function ( arcgisUtils, ...


2

The geometry column of a ShapeFile must be called "the_geom", your's is called "location" so the ShapefileWriter ignores it. change SimpleFeatureType featureType = DataUtilities.createType( tipoShape, "location:" + tipoShape + ":srid=4326," + "number:Integer"); to SimpleFeatureType featureType = DataUtilities.createType( tipoShape, "the_geom:" + ...


1

You need to close the polygon by adding the start point to the end of the list of points that you build the WKT with. So change it to: for (var z = 0; z < arreglo.length; z++) { arreglo2.push(arreglo[z][0]+" "+arreglo[z][1]); } arreglo2.push(arreglo[0][0]+" "+arreglo[0][1]); But I'm pretty sure you can use the OpenLayers WKT ...


1

Once you have your geojson back use the ol.format.GeoJSON() to parse the object and create the features. var format = new ol.format.GeoJSON(); var myGeoJsonObj = ....asign the geojson result here var myGeoJsonFeatures = format.readFeatures(myGeoJsonObj ) and then you may place your features in a vector layer using. ...


1

In the example you provided, you can see two events associated with the map object: click and pointermove. If I understood you well, you just have to switch the click event callback function with the pointermove event.


1

If you are using Openlayers see here. If you are using leaflet see here. For pure javascript see here or for NPM resources here or here There are other solutions beyond these but this should be enough to be getting on with.


1

GraphHopper is able to run offline in the Browser with the help of TeaVM See here for the examples. See here the blog post about it See here is the source repository Note: I'm the author of GraphHopper ...


1

There are a couple of things wrong in your code. First of all, you should use createVis instead of createLayer in order to set map options. Then, you have to use as function arguments vis and layer/s if you want to set interactions. Here I have built a working example using createVis with map options like the ones in your params object. :-)


1

L.geojson accepts all the Path options as well, so you can set the color parameter in the L.geojson options to a color of your choice. var map = L.mapbox.map('map', 'mapbox.streets') .setView([42.87596410238254, -100.546875], 4); // Start and end points, in x = longitude, y = latitude values var start = { x: -122, y: 48 }; var end = { x: -77, y: 39 }; ...


1

var baseLayer = new ol.layer.Tile({ source: new ol.source.OSM() }); var circle = new ol.geom.Circle(ol.proj.transform([-73.5971431341708, 45.5323780468158], 'EPSG:4326', 'EPSG:3857'), 1000); var CircleFeature = new ol.Feature(circle); var vectorSource = new ol.source.Vector({ projection: 'EPSG:4326', }); ...



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