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)

0
votes
1answer
52 views

Geolocation is not working on my mobile device (USER DENIED GEOLOCATION) - Openlayers 3

I have the Openlayers 3 Geolocation API working on non-mobile browser correctly, but I get 'User Denied Geolocation' error testing on mobile devices. What could be the reasons of this error? If it ...
1
vote
0answers
20 views

Add layers dynamically on a web map

What would be an optimal way to add a layer to the web map by using the drag and drop option? Should the layer be saved to the db or their are other ways? This would be a JavaScript based application ...
1
vote
0answers
37 views

ESRI Javascript KMLLayer and CSVLayer

I have a map where I have a KMLLayer that defines a geographic boundary and a CSVLayer that defines points within that boundary. I do not want any infoWindow information popping up for the KMLLayer ...
2
votes
1answer
31 views

Is it possible to pass a JavaScript object to “Layers:”?

I am trying to use the GetFeatureInfo functionality of Openlayers v3. I am taking the layer name dynamically from the layerswitcher and trying to pass it into WMS like: var ...
1
vote
1answer
39 views

Getting Node.appendChild error with leaflet

I am trying to add a popup function to some polygons. I've been consulting a few different tutorials trying to work it out and I'm concerned that I am getting conflicting instructions. The map I have ...
1
vote
0answers
39 views

500 Internal Server Error:System.InvalidOperationException: Missing parameter: settlementlocationcode

Here I'm trying to bind the data from database to table for selected features within the user entered buffer distance. This is working for simple query, but it doesn't work for query using PostGIS ...
0
votes
0answers
35 views

how to stop the marker from dragging?

I'm making a form that reads data from a map and puts it in an input field to be inserted into a database. The latitude and longitude were taken perfectly and inserted as expected but my problem is ...
2
votes
2answers
34 views

Knowing if map has specific custom control in OpenLayers 3?

I created my own custom control for openlayers 3 as follows: window.app = window.app || {}; var app = window.app; /** * Control Creado para moverse por el mapa (quitar controles de dibujar...) */ ...
0
votes
1answer
65 views

Zoom to and Spiderfy MarkerClusterGroup, open popup of target marker

I am trying to zoom to a specific marker and open its popup using an external onclick event. To achieve this I need get the leaflet ID of the target marker, spiderfy the MarkerClusterGroup and call ...
5
votes
1answer
35 views

Attempting to map GeoJson file producing issues

I've been trying to get this to work for some time now. The end goal is to produce a map I can show using d3.js, however d3 is butchering the map and producing an undesirable image. The code is as ...
0
votes
1answer
55 views

How to remove or disable dragbox, dragzoom interactions in OpenLayers 3?

I am using the code to zoom the map by clicking and dragging on the map, but I want to remove this interaction when I press another button. How can I remove this? This is my code: var dragZoom = ...
3
votes
1answer
81 views

Extract geojson 'properties' dynamically with mapbox gl

I have an interactive map based on MapBox WebGL. I have an 'on click' function which is returning all information on data layers at that location (lovely). For each object I am trying to pull out ...
4
votes
1answer
104 views

D3: center a map feature using correct latitude and longitude, without rotation?

The following is a map of Chicago which I've created in D3.js, and the JS code to render it. I had a very hard time centering Chicago within my viewfinder (the white box). After much trial and ...
1
vote
1answer
32 views

Set view does not work after Fitbounds

I have a map and a layergroup. var map = L.map('map').setView([27.6758,85.3313], 12); L.tileLayer('http://{s}.tile.cloudmade.com/8ae544230be74379927e6dee5d416398/997/256/{z}/{x}/{y}.png', ...
3
votes
1answer
113 views

qgis2web problem with lots of data

A few month ago I was able to make a polygon map of population: http://supermap.hostei.com Today I opened the same QGIS project and tried qgis2web again. The plugin interface had responding ...
1
vote
1answer
62 views

Openlayers 3 - click under geolocation layer

I am using geolocation feature of Openlayers 3.13, as in the examples. (http://openlayers.org/en/v3.13.0/examples/geolocation.html) However I also have queryable point layers, and when I track the ...
1
vote
0answers
43 views

Leaflet drag scrolling on mobile

My leaflet map is between a navigation bar and a chart displayed underneath. Unfortunately after recently incorporating leaflet-1.0-beta-2 my responsive layout is not working out on mobile devices ...
1
vote
1answer
114 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
19 views

Adding additional markup to leaflet marker_

I'm trying to customize the html output for my leaflet markers. Specifically, I'm trying to assign them additional data attributes to trigger bootstrap modals based on an ID pulled from the database ...
0
votes
0answers
32 views

Creating a buffer radius around a point

I would like to create a buffer radius of 1km around a set of points in my WFS layer (I'm using OpenLayers 2). I've tried creating a style but it only makes the points look bigger. Below is my WFS ...
1
vote
1answer
49 views

Problems with case statements in Leaflet's pointToLayer

I am trying to create a layer that has different types of business (separated by code properties in the geojson file) but when it executes the pointToLayer below I get an Uncaught TypeError: Cannot ...
1
vote
0answers
36 views

turf.intersect of a turf.polygon and a turf.linestring?

With the JavaScript library turf, when I try to use turf.intersect(polygon, linestring)) I get the following error: ReferenceError: 'coords' is undefined at ...
0
votes
1answer
76 views

Leaflet OSM Geocoder not working

Maybe this sounds a silly question but the leaflet OSM Geocoder published here Leaflet Control Geocoder doesn't work for me. I can see the search bar but when I search something, nothing happens. The ...
0
votes
0answers
24 views

How can I strip spaces from a moustache template field in CartoDB infowindow?

I have a custom infoWindow on a cartodb.js map which uses moustache templates to populate the fields in the infoWindow. In it I have a link to tweet a correction to the map which I populate with the ...
2
votes
1answer
47 views

Leaflet Map not Visible

I try to make my first Leaflet webmap (I'm very new to JavaScript so please ignore the dirty & repetitive code). I want layer controls and read the Leaflet layer control example but somehow my map ...
2
votes
1answer
63 views

How to set bounds and make map bounce back if moved away?

I wanna make this map bounces to the center, and make the red line the limit that you can move the map. Don't know why my fitbounds doesn't work. Any help? My code: var mapBounds = ...
1
vote
2answers
63 views

Snap polygon to grid (lat/lon)

I'm trying to code this in Leaflet, but the key is finding the formula to do this. Give a polygon (filled in the image), how can I expand it to fit a grid (lat/lon, outer line in image) ? This is ...
2
votes
1answer
59 views

Coordinates translation issue (from EPSG:23030 to EPSG:4326)

I'm trying to figure out how to make some translations from UTM/ED50 to WGS84. The reason I need to do them is that my data source's coordinates are in EPSG:23030 format, and I need to represent them ...
0
votes
0answers
25 views

Why is BorderContainer and ContentPane methods are not called for map and attributeInspector elements using ArcGIS API for JS?

I'm trying to display the attribute inspector on right-side panel when a feature 'onclick' event is called, but whenever i click on a feature the attribute inspector shows-up on left-side of the ...
1
vote
0answers
19 views

Plotting GPS plot without uploading data

I'm not sure if this is possible or not, but I'm wondering if its possible to plot a GPS dataset without uploading the data first to CartoDB. I've been analysing some data by uploading the postcode ...
1
vote
0answers
16 views

OpenLayers 3 - Source with multiple available projections

Is there anyway to specify a (Tile)WMS source that supports multiple projections? For example, my WMS server supports requests for both EPSG:4326 and EPSG:3395. So if the projection is supported in ...
2
votes
1answer
114 views

OpenLayers 3 create bounding extent which includes two points

I'm working with openlayer3 in my ionic application and am stucked with the problem with creating a bounding extent to get a few points in the viewport. My code looks like this: var destLoc = ...
0
votes
0answers
42 views

Tips on building GeoReferencing web app with MapBox?

So I want to build a web app using MapBox GL JS that allows users to Upload an image (preferably any kind) Position it on to a map The image is then uploaded to MapBox as a GeoTIFF and is added as a ...
2
votes
2answers
264 views

Leaflet TypeError: this._northEast is undefined

I have some codes used Leaflet and I want to refactor them below one is working: jQuery(document).ready(function(){ $.post("StatisticsResultServlet", { ...
3
votes
1answer
61 views

Checking if two WGS84 lines intersect in JavaScript

I am trying to work out given two GeoJSON lines (WGS84), if they intersect (i.e. cross one another). Let me give some pseudocode to illustrate: // Providing Line 1 = lon1, lat1 and Line 2 = lon2, ...
3
votes
1answer
45 views

How to fully Style a marker in leaflet?

Styling a marker is possible with pointToLayer I dont know how to get a marker change style for mouse over and for click etc.... var map = L.map('map', { zoom: 14, ...
0
votes
0answers
25 views

How to show a legend of a invisible layer in ArcGIS javascript?

Using the JavaScript API for ArcGIS, I'd like to show the legend of a DynamicMapServiceLayer that's not visible. Is this possible? The result would be a static legend that's always there, no matter ...
0
votes
0answers
29 views

opnenlayers 2 marker icon showing up at wrong coordinates position

the code is written using openlayers2 with bing. I want to add a marker with a custom icon. The code partially works and the marker icon shows up on the map. My only problem is it shows up in the ...
1
vote
0answers
48 views

How to search vector layer features in Mapbox GL JS

I need to add a search bar that will search vector layer attribute features which are hosted by mapbox. I'm using the Mapbox GL JS API. I know this can be done fairly easily with Mapbox js/Leaflet. ...
3
votes
0answers
30 views

Attachment editor esri duplicate files

I am using arcgis API's attachment editor var attachmentEditor = new AttachmentEditor({}, dom.byId("content")); attachmentEditor.startup(); featureLayer.on("click", function(evt) { ...
0
votes
1answer
56 views

How to show/hide markers that are inside a function using js?

I have a map with a lot of markers that are pulled from this function: function showResourcesByName(name) { for (var i = 0; i < markers.resources.length; i++) { var resName = ...
0
votes
0answers
19 views

Creating Interactive Web Map? [duplicate]

After a bit of help. I am looking at creating an interactive map for a website. There seem to be hundreds of different ways of approaching this. Wondering if anyones got any really good examples of a ...
0
votes
1answer
23 views

Modifying OpenLayers 2 to connect to different WMS using JavaScript?

I have a program that runs in tomcat and uses JavaScript to access a postgreSQL database as well as Google, Yahoo, Geoserver, and Open Street Map map services through OpenLayers 2.12. I would like to ...
0
votes
0answers
37 views

Rotate polygons in JavaScript using openlayers

First, thanks for answer my first question. Today, I want to know some ways for rotating polygons. I already success using spring and server, but what I want to do is rotating polygons using 'only' ...
3
votes
1answer
31 views

How to hyperlink from polygon oncick in Leaflet?

I want to hyperlink from onclick of a polygon to new tab based on 'link' field in polygon json. When user clicks on polygon, a new browser tab is opened pointing to URL value of that polygon. I am ...
2
votes
1answer
322 views

MapBox GL geoJSON markers disappear when custom style loaded

I am using this example to load geojson points to to a mapbox basemap. I view it on a browser locally and it works. When I change the style reference to my custom style, the style will display, ...
2
votes
1answer
60 views

Mutually Exclusive Bootstrap Checkbox Switches as Layer Control

I have this JSFiddle with two checkboxes using Bootstrap Switch that changes the layer visibility in Leaflet. I would like them to be mutually exclusive, i.e neither of them can be on or off at the ...
0
votes
0answers
45 views

AttributeInspector is not showing up on 'click' event using ArcGIS API for JS?

I'm creating a application to select features on event 'click' and then using AttributeInspector to edit the attribute fields. I'm also creating draw tools to select features on event click and ...
0
votes
1answer
60 views

Change Bootstrap Switch Depending on Leaflet Layer Zoom

I have this JSFiddle that as you can see has two tile layers. I have set the minZoom of the 'Example Layer' to 5 so that it only loads once you have zoomed in that far. The issue is, using Bootstrap ...
0
votes
0answers
269 views

Access-Control-Allow-Origin in geoserver and ol2

Good morning, I m trying to get a pop up from my map with the getfeauture code. I tried to followed the following example. When i tried to run the code i get the following error in my console: ...