JavaScript is a prototype-based, object-oriented scripting language that is dynamic, weakly typed and has first-class functions.

learn more… | top users | synonyms (1)

1
vote
2answers
1k views

OpenLayers vector does not draw (or re-draw) on zoom level change or layerswitcher off/on

Here is the full code (i'll highlight the important parts after): jQuery(document).ready(function($) { // ...
0
votes
1answer
404 views

Plotting GeoJSON data on map using ArcGIS API for JavaScript?

We are developing the portal in which we are using Arcgis javascript APIs.The requirement in our project is one of the weather provider is going to publish the webservice which will return the weather ...
0
votes
1answer
444 views

google.maps.InfoWindow is not working

If anyone encountered the same problem and come up with the solution please give me an idea if what's wrong with this code. The InfoWindow is not working when i click the map polygon. All parts ...
1
vote
1answer
74 views

leaflet.heat heat map highlighting overlapping areas

Lately I've been working on heat maps using the leaflet.heat plugin. I have a set of points in the WGS84-system with the following structure: latitude | longitude | weighting | type The ...
0
votes
0answers
6 views

Loading a stateGeoJSON across countries

I am trying to build a chloropleth map in Javascript with zoom functionality. Map will need to have a chloropleth layer of all countries. On zooming in it will need to show a chloropleth of the next ...
0
votes
1answer
187 views

Create a polygon from an array of coordinates in arcgis javascript api

Well I am building a GIS web app using ArcGIS Javascript API , I want to create a user interface in which the user provides an array of coordinates and I have to get those coordinates and create a ...
0
votes
1answer
176 views

Openlayers 3 custom Polygon feature

I'm trying to create a custom Polygon style for my layer style. I receive some information about position, orientation and age for a number of objects and I want to represent those as zoom ...
1
vote
1answer
176 views

Click event doesn't work with with Google Maps

I'm trying to create a simple click event when I click on a list item on my page, a marker should be created on the google map in that page. But it does not happen. Is there some google maps API ...
0
votes
0answers
6 views

How to add custom CSS class to leaflet tilelayer

I am working with mapbox.js and leaflet to create a map with a number of overlapping tilelayers. I want to apply some custom CSS to only selected tilelayers, and thus assign these layers to an ...
2
votes
1answer
315 views

Using Odyssey.js with Cartodb.js

I'm looking to use Odyssey to create an interactive introduction to various data layers on an interactive web map I've created using CartoDB.js. I'd like to have different data layers turned on / off ...
2
votes
1answer
220 views

Showing link for every city at different zoom levels using Leaflet?

I have a Leaflet map that I am using to render a map of the U.S. The map will have specific zoom levels. For example, when the map first loads it will show major U.S. cities. Then if you zoom in it ...
5
votes
3answers
10k views

Add GeoJSON layer to OpenLayers 3

I have a GeoJSON file called mygeojson.json and I want to add it as a layer in OpenLayers 3 on top of an openstreetmap layer. So far I could display the openstreetmap world including zoom etc. but for ...
0
votes
2answers
25 views

How to get the distance between a point and a line in openlayers 3?

I've been working lately with openlayers 3 and trying to get a fully offline Mapping app, I am trying to get the smallest distance between a point and a line. I looked for a solution in the api and ...
1
vote
1answer
237 views

Openlayers filter strategy on wfs deactivate problem

I have a filter control which works nicely. However, when I try to reset/remove the filter, I don't get the original features back. The debugger shows my features array as still only being the reduced ...
0
votes
0answers
19 views

Markers display with leaflet and javascript

I have a problem displaying data relating to schools on a div 'info' when click the marker with leaflet and javascript: here's the error: Uncaught TypeError: layer.setStyle is not a function
-3
votes
0answers
15 views

condition that displays two div different with leaflet [on hold]

I wanted to create a condition that displays each time according to different div click on the data on the map
1
vote
2answers
968 views

Using snap point when using measurecontrol in OpenLayers?

I have a problem about measurecontrol. I can use measurecontrol and I can show length to use measure control . But my problem is that I didn't use in snap because measurecontrol is a control, not a ...
1
vote
1answer
21 views

PostGIS raster to UTFGrid

I am trying to create a UTFgrid JSON with a Raster in PostGIS. The goal is to provide weather data for web maps. I found some libraries: https://github.com/Ecotrust/create-utfgrids ...
1
vote
0answers
10 views

Export features to pdf using JSPDF and Openlayers 3?

I built a map with different type of data, WMS layer, Vector Layers ( features extracted them from GeoJson file). Used Technologies : - Openlayers 3 - JSPDF How can i export just the selected ...
2
votes
1answer
318 views

How do I modify the WebAppBuilder "LayerList' widget to use radio buttons instead of checkboxes?

I've downloaded the developer version of the Web app builder and installed in on my machine. I can open up the widget '\LayerList\LayerListView.js', and I have been exploring the source code. I would ...
2
votes
0answers
14 views

3D Visualization in 3D

We have published a geoprocessing tool that gives Raster dataset as output. we are using arcgis javascript api 4.0 version to visualize it on map. But when we use gp.getResultImageLayer , the event ...
2
votes
0answers
11 views

AttributeTable sending an alert that data was not found when clicking on table row

I have an AttributeTable that I have opening when I start a widget. When I click on a table row in this instance, I am able to get the information back correctly and not see this message. I did this ...
0
votes
0answers
123 views

redraw canvas when add new overlay?

How to redraw canvas when I add overlay layer? Firstly load osm map, then creates canvas. So when I push the botton and add another layer it looks like sandwich and canvas in a middle...first layer - ...
0
votes
0answers
13 views

Openlayers popup not working in IE11

In a js file in openlayers3, this code is not working for Internet Explorer. The problem is after popupLayers, is there a way to make this work in Explorer. var container = ...
1
vote
0answers
12 views

Leaflet printing does not show pins and map is shifted

I don't exactly why but whenever I try to print my leaflet map with layers, it shows the map a little shifted to the left as well as the pins are not quite ok. I tried using easyPrint() and ...
1
vote
1answer
203 views

How to create a infotemplate that displays automatically

I have created a postcode search that that highlights a polygon and zooms in. but I would like it to display a infoTemplate box with having to click in it. I want it to show when the function runs. ...
0
votes
2answers
35 views

OpenLayers 3.15.1 - styleFunction is executed every time I move/change the map

I'm testing the new OpenLayers v3.15.1 and I've a simple question about styleFunction used to plot GeoJSON. My code contains: var vectorSource = new ol.source.Vector({ url: <my geoJson ...
1
vote
0answers
18 views

Non-HTML circle text labels on Leaflet map

I need to save image of Leaflet map with polygon, multi-polygons, circles and text below every circle. I have geojson file with circle and polygon coordinates (lat and lng). I managed to get image of ...
1
vote
1answer
547 views

How to add custom basemaps to BasemapGallery

I would like to add my own custom basemaps to the BasemapGallery. Is there any way I can create my own BasemapGallery with only my maps? I am using the ArcGIS API for javascript. EDIT: for clarity I ...
1
vote
0answers
14 views

Leaflet polyline not working

I'm trying to draw polyline to connect an array of waypoints. But I'm getting an empty div like this instead of a map with route. My code is this: <script> // set center ...
1
vote
1answer
36 views

OL3: data from WFS is added multiple times

I added a ol.source.Vector to my map which receives data from a wfs. Currently I am using ol.loadingstrategy.bbox because there is a lot of vector data and it would take too much time to load it all ...
7
votes
2answers
58k views

How do you get the coordinates from a click or drag event in the Google Maps API V3?

I have made a Google Version 3 Geocoder , I want to be able to pick up the coordinates of the marker when it is dragged or clicked. Below is my code: <!DOCTYPE html> <html> <head> ...
0
votes
1answer
340 views

Parsing XML file with hundred polygons using OpenLayers

I'm using this script but It's not working. <script type="text/javascript"> var raster = new ol.layer.Tile({ source: new ol.source.OSM() }); var xml = new OpenLayers.Format.XML(), wkt = new ...
0
votes
0answers
9 views

How to add multiple JSON files in Gmaps

I'd like to add more than one JSON file into Google maps, using its JavaScript API. In the documentation we the way to add a file is using the following line of code: ...
2
votes
1answer
47 views

Leaflet Routing Machine: how to dinamically change router settings?

I'm using Leaflet Routing Machine in a litte Leaflet + Javascript map. I'm using Graphhopper as router in this way .... var control = L.Routing.control({ waypoints: [ L.latLng(57.74, 11.94), ...
0
votes
0answers
11 views

how to delete vector layer on button click in openlayers 3

Here i'm trying to remove the vector layer when i click on delete button , but somewhere its not working its only hiding the feature not deleting it . Because when i'm calling it start overlapping all ...
4
votes
2answers
738 views

Authentication in Geoserver 2.4.x from a web application

I am trying to build a web application using html and javascript from which I want to login to geoserver hosted at: https://weaveprod.ucdp.utah.edu/geoserver/web/ I have written the following code for ...
4
votes
2answers
204 views

Lat/Long -> UK Easting/Northing?

I have a fairly accurate formula (implemented in C#), which allows me to convert UK Eastings/Northings to WGS84 Latitudes and Longitudes. Despite extensive Google searches, I could not find a formula ...
7
votes
4answers
5k views

Layer loadstart & loadend events in OpenLayers 3

OpenLayers 2 has these layer events "loadstart & loadend." What is equivalent to them in OpenLayers 3? While a vector layer loads and is rendered, I need to show a loading icon.
2
votes
0answers
20 views

Line Layer seems to be floating and shifted after adding terrain effect in Cesium

I had made add a line layer using cesium. In which i had added a terrain effect using the standard cesium terrain provider as below var dataSource1 = new Cesium.GeoJsonDataSource(); var roads = ...
2
votes
1answer
26 views

Convert/display grayscale image as RGB

i want to display raster images using a color palette in a leaflet map. The images are tiled (gdal2tiles) from a single .tif to multiple .png files with values from 0 to 100. I add the image using ...
0
votes
0answers
18 views

Move multiple features, arcgis API for javascript

Is it possible to move more than one feature (polygon, line or point) at the same time using ArcGis Javascript API?
1
vote
1answer
558 views

ArcGIS javascript API setDefinitionExpression returns wrong result set

New to GIS and ArcGIS. I am trying to use the javascript API setDefinitionExpression to limit the output of a FeatureLayer on the map; however, the result set returned by the function is incorrect. ...
0
votes
1answer
34 views

Openlayers 3 - ol.layer.Image rendering on drag'n'drop

I'm using the lastest version of Openlayers 3, aka 3.15.1. I want to use layer = new ol.layer.Image({ map: olMap, source: new ol.source.ImageVector({ source: new ol.source.Vector(), ...
1
vote
1answer
13 views

What is default unit of calculated area in turf.js?

Here is a good example how to calculate area in turf.js http://turfjs.org/static/docs/module-turf_area.html But what is its unit of area measurement (acre/hectare) ?
1
vote
2answers
180 views

Openlayers - ModifyFeature - How to label vertices with a progressive number

I am quite new in openlayer and javascript. I have a control ModifyFeature on a path vector layer. I would like the vertices to be rendered with a stylemap label showing their progressive number ...
1
vote
1answer
225 views

Legend ArcGIS Javascript does not recognize Legend from ArcGIS for server 10.2.2

I have created maps in ArcGIS for desktop and published them to ArcGIS for server 10.2.2. Because of performance issues I have created a group layer of the same map with different levels of details. ...
3
votes
1answer
77 views

Using MSID/MID with leaflet to display Google My Maps data

I'm wondering if there is a way to display MSID/MID with leaflet. I found this forum below; Any way I can load KML data from Google maps (again) via JS API? KMZs work fantastically with the arcgis ...
0
votes
2answers
24 views

Split string of coordinates and put it in array

After doing the funtion: cirkelFeatures[1].getCoordinates().toString() I'am receiving the coordinates of the polygon (they are in epsg 31370) ...
0
votes
1answer
87 views

OpenLayers 3: does not display all Features of Layer

I'm using openlayers 3 and geoserver. I want to get and display a wfs layer with openlayers. this is source of my layer: vectorSource = new ol.source.Vector({ format: new ...