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
5 views

Add logo to a map using Leaflet/Mapbox

I am currently trying to learn how to use Leaflet / Mapbox (and JS, to some extent) by creating custom test maps. My problem is that I want to add a logo on the top of my map, with absolute ...
0
votes
0answers
9 views

Leaflet - Edit Feature Attributes in popup [on hold]

I'm looking to make attributes shown in my click popup editable. I've been piecing together from Leafletjs and many search sources but have hit a wall. GitHub Index Here is a sample I've found which ...
2
votes
2answers
50 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 ...
3
votes
2answers
506 views

Openlayers map WMS stretched by latitude

I am working on a small javascript application for displaying map with WMS layers from 2 servers. The problem is, that image is stretched by latitude, it is wider, as it should be. This is is how it ...
3
votes
2answers
4k views

Google Maps need to click twice to get marker click event to trigger

I have a google map that I am populating with real estate listings from a database. I have set it up to refresh the listings when the map is panned or zoomed. I am using the dragend & ...
0
votes
0answers
15 views

ArcGIS Online - getting token through JSON

I'm new to using JSON and think I vaguely understand it. This may well be more of a Javascript question than a GIS-related one. Basically, I've got a map on ArcGIS Online and I'm looking at putting ...
0
votes
0answers
70 views

Rotate polygons in JavaScript using openlayers

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' Javascript and openLayers3, not using server. Here ...
1
vote
2answers
188 views

how can I specify a popup to show only for a specific layer in openLayers 3?

I am using the function to define popup contents in a map, and right now, it createa a popup for every feature I click on the map, no matter what layer it is in. I would like this popup to appear only ...
0
votes
1answer
19 views

Multiple Selection with OL2

I created a map with some marker which can be selected and have them name appears in an external field. But i even if i am able to select multiple marker on the map ( shift command ), only one name ...
1
vote
1answer
17 views

Openlayer3 icon mouse hover animation

I am using openlayer3. And using icon as a marker. So my requirement is that when I hover on marker, it should increase in size to show that it is hovered. Till now I have success to detect the icon ...
1
vote
1answer
20 views

How to perform dynamic filtering of multiple check boxes using cql_filter and openlayers javascript?

I have multiple checkboxes for example hospital checkbox where hospital datasets get displayed when checked, phase 1 check box where phase 1 hospitals get displayed when checked and grade A and B ...
0
votes
0answers
1 view

GeoRSS in Openlayers 3

I have used georss files successfully in openlayers v2.x but I am not able to find how to handle these georss files in Openlayers v3.x. Please help if anybody has successfully tested
3
votes
1answer
569 views

how to disable duplicate items in the legend for ArcGIS JavaScript API

I have a problem with duplicate items in the legend panel! Can anyone help me? This is my feature Layer with popup info: // Feature Layer var msFeatureLayer = new esri.layers.FeatureLayer(...
0
votes
1answer
19 views

leaflet - change routing vehicle when clicked on button

I want to change the routing vehicle when clicked on a button. The default routing vehicle is "car" ("auto") when clicked a button routing vehicle should change to "foot" ("pedestrian"). I am using ...
1
vote
1answer
792 views

Google Hybrid Map tiles won't load in OpenLayers when centered on certain position

Since the Google Maps API update to V3.2 (17 Feb 2015) our maps have not been loading to their initial state, centered over the Gulf of Mexico. When the center location is: center: new OpenLayers....
0
votes
1answer
16 views

Stop event in OpenLayers3

I used the example of this website : http://openlayers.org/en/v3.8.2/examples/feature-animation.html for make an animation. I don't have problem for stopping the event with the function clearInterval(...
0
votes
1answer
36 views

Mapillary JS: mapillary-js storytelling [RouteComponent] hangs

I'm trying to use Mapillary JS (rif. http://blog.mapillary.com/update/2016/02/10/mapillary-js.html), to build a storytelling following this sample http://bl.ocks.org/knikel/630c2d6fa37a8a0e082a. This ...
0
votes
0answers
13 views

xml parsing from url in javascript (OpenLayers)

I have a question concerning parsing an XML url. I have a geocode function implemented in my javascript: function findAddress(){ var address = document.getElementById('address').value; var ...
0
votes
0answers
15 views

calculate new point given distance, bearing, lat and lon Right lat result but wrong lon

I have been trying to get this program to work right, but somehow, although my formular seems right, my calculation for the longitude is off. I want to make a plugin for qgis with this code, or find ...
0
votes
1answer
19 views

draw polygon is not getting end

I have tried the draw polygon, and followed by example i have done like below code <!DOCTYPE html> <html> <head> <title>Measure </title> <script src="...
0
votes
2answers
19 views

OpenLayers : Draw shape from external geojson file

I am trying to draw a shape (airplane) from external geojson file. Said shape uses data from 2 object structures inside the geojson file. I can load both shapes separately, but I can't append/join ...
0
votes
1answer
20 views

Openlayers3 Add click/hover action on ol.layer.Vector

With drawService function, I add on my map dome circle vectorLayer. How can I set a click (or hover) event on the added vectors for displaying their long lat coordinates? function drawService(...
0
votes
0answers
11 views

How to extend Geocoder (Nominatim) with own/distinct address

I want to extend my Geocoder for my leaflet routing map. I am using leaflet routing machine and nominatim geocoder to implement routing and geocoder. Now my goal is: I want to put an a specific ...
0
votes
1answer
34 views

Can't load geoJSON files in Leaflet layer control

First of all, I have to sorry about my English. May not be perfect. I have a problem with show my geojson files into layer control. I read every topic about that on this side, i have tried on a milion ...
0
votes
1answer
113 views

How to load tiles from geopackage properly using OpenLayers3 and GeoPackage-JS

I am trying to load tiles from a geopackage (rivers.gpkg sample) using the latest version of OpenLayers3 and the GeoPackage JS library (Project-Link). My current try looks like this: As you can see ...
1
vote
1answer
673 views

Add an event listener on a Marker in Leaflet

I am using leaflet in order to render a map. I created a map with markers and i dont know how to implement the Event Listener 'onClick' on each Marker. My code var stops = JSON.parse(json); var map ...
0
votes
1answer
287 views

OpenLayers 3 doesn't want to draw programmatically a polygon

I am using OpenLayers 3 and i am trying to draw a polygon using given coordinates , but it doesnt want to draw it . var source = new ol.source.Vector(); var ring = [ [...
1
vote
1answer
21 views

Set background color and opacity for a WKT layer vector in OpenLayers3

I have this function: function drawLayer(wktRegion, name,colour = "transparent"){ var format = new ol.format.WKT(); var feature = format.readFeature(wktRegion); feature.getGeometry()...
2
votes
1answer
22 views

change width of outline for leaflet map depending on zoomlevel

I want to change the outline of a polygon depending on the zoomlevel. I thought it's easy to implement but there must be something wrong. My polygons dissapear when I try it with this code: to get ...
0
votes
1answer
309 views

Convert Leaflet WMS layer to Leaflet GeoJSON layer

Using the Leaflet API I am adding a WMS layer through the L.tilelayer.WMS feature. This feature includes only a certain amount of options such as 'layers','crs','style' etc. Through the Leaflet ...
3
votes
3answers
5k views

Problems with ESRI JavaScript API

I'm having some problems to get started using the ESRI JavaSript API. I have a test map service published on my notebook but I can't get it to display. I don't have problems with esri hosted services, ...
0
votes
1answer
301 views

getting attributes of Openlayer Map by Javascript

I have created an OpenLayers map via the following code: var map = new ol.Map({ target: 'mapdiv', layers: [ new ol.layer.Tile({ source: new ol.source.MapQuest({layer: 'sat'}) }), new ol.layer....
3
votes
1answer
82 views

Rotate geojson feature with Leaflet

I have a GeoJson feature that is rendered with leaflet and proj4(ESPG:31467). Now I want to rotate that feature so that it NW corner points to NE, e.g. 90 deg rotation. Is there a way to do this? Or ...
0
votes
0answers
6 views

How to get features on the map at (x, y) position using OpenLayers 3? [duplicate]

I'm trying to get every feature at (x, y) position using this code : map.on('singleclick', function(e){ var features = []; map.forEachFeatureAtPixel(e.pixel, function(feature, layer) { ...
0
votes
1answer
23 views

Area measurement with out geodesic in openlayers3

<!DOCTYPE html> <html> <head> <title>Measure example</title> <!--<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>--> <script src="...
0
votes
1answer
31 views

CartoDB- popup window not working

I am working on a project, and I have not worked with cartodb long, but there is something wrong with this code. It is supposed to display a little pop window showing the school district for that ...
1
vote
1answer
264 views

ArcGIS JavaScript Web Application: Workflow for Tokens?

This may appear to be a duplicate but I can't find any online source which is able to help me. Essentially, I want to protect a web Service from unauthorized access but still need to allow a web ...
1
vote
2answers
19 views

Add Leaflet layer based on variable with the same name?

I have a geojson layer named mapLayers and another geojson layer named lmiCounties, with a dropdown list with an item with the id lmiCounties. I want the second layer added to the first, which has ...
0
votes
2answers
30 views

Leaflet Sidebar - set content depending on clicked GeoJSON feature

My goal is to set the content of the sidebar depending on what GeoJSON feature was clicked on. For example when clicked on polygon A the content of the sidebar is: "This is A" and when clicked on ...
6
votes
2answers
237 views

Access GeoJSON from GitHub in Leaflet

I am new to JSON, GitHub, and Leaflet. But I am trying to create a simple application which will render my points which are in GeoJSON up on GitHub. From everything I have read this should work. ...
5
votes
1answer
459 views

Hexagon binning using Google Maps

I have a bunch of geolocated points that I am looking to cluster on a google map using hexagons. These clusters will be stored in a db for quick retrieval and will be reduced to a single point and ...
3
votes
1answer
25 views

GEOJSON - Transition to cartogram

I have 2 GEOJSON files - 1st contains map of indian states ('India-simple.GEOJSON'), and the second is cartogram based on Gross State Domestic Product of that state ('India-cartogram.GEOJSON'). I ...
1
vote
1answer
496 views

Why do I have to reload the page, to show the Map correctly?

I added a map, in the way I'm supposed to, but why do I have to reload/refresh the page, to get the map (almost) as I want to? This is, what I mean: Map before reloading the page: Map after ...
1
vote
0answers
19 views

ESRI ARCGIS Flex - Javascript migration

We have a current architecture of FlexViewer and part ArcGIS Flex API based custom tool that's sitting on a IIS server to draw zones. ESRI is migrating to ESRI Javascript API and we have two options ...
0
votes
0answers
22 views

Globe not displaying in my cesium application

Below code doesn't display the default cesium globe.When i run my file, its just a black background. Why is it so? <style> @import url(../templates/bucket.css); </style> <div id="...
0
votes
0answers
11 views

Creating a CQL filter function in Openlayers 2.10

Im having trouble with creating a CQL search function of my geoserver wms in OpenLayers. Im am running a 2.10 version of OpenLayers. Im a rookie in coding, so I'm trying to implement this example: ...
1
vote
1answer
25 views

Selection with circle using JSTS

Anybody know if there is a possibility of using JSTS library with OL3, to create a circle for selecting marker in a map. Actually i succeed creating a polygon which can select markers and return the ...
1
vote
1answer
197 views

highlight feature with click in mapbox gl

I have a geojson layer of streets that are highlighted when moused-over. My objective is now to highlight individual streets red with a click event. Only one street should be able to be ...
0
votes
1answer
226 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
42 views

Select one feature of multiple overlapping features (here polygons) on a Leaflet map

I have a map with multiple polygons rendered on it which can overlap eachother. I use leafletPip.pointInLayer(point, layer) from https://github.com/mapbox/leaflet-pip for determining which polygons do ...