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
253 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 ...
1
vote
1answer
22 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 ...
0
votes
0answers
4 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 ...
0
votes
2answers
507 views

interactive map inside a HTML5 canvas

I'm writing a map based simulation using the HTML5 canvas and javascript. the mechanics of the simulation are working well but to be application to real space is not progressing at all. I'm ...
1
vote
1answer
368 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
1answer
17 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 ...
0
votes
1answer
17 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
1answer
408 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. ...
3
votes
2answers
433 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 ...
0
votes
0answers
17 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 ...
0
votes
1answer
30 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 = ...
1
vote
1answer
22 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
15 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
9 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
2answers
45 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", { ...
0
votes
1answer
1k views

OpenLayers 3 Zoom to extent only working in debug?

I am using gpx data to display routes with open layers 3 and my attempts of zooming to fit the gps trace have been thus far unsuccessful. I only ever got it working in debug mode on firefox, where it ...
0
votes
1answer
27 views

Open layers3 drag box interaction not pointing correctly

I am using open layer 3.9.0. I Want to add and remove dragZoom and dragBox interactions in openlayers3 map dynamically. <button id='box'>dragBox</button> var dragBox = new ...
3
votes
1answer
31 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, ...
1
vote
0answers
10 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 ...
1
vote
1answer
19 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 = ...
2
votes
0answers
593 views

It is possible put highcharts chart in openlayers popup?

As title. I build a openlayers map on my website. and there are many feature vector on the map. now I want to put a highcharts charts in popup. to show the temperature in every city something Like ...
-1
votes
1answer
80 views

Python or Javascript focus (for self-directed study at university) [closed]

Next semester is my last at university. I have taken all 3 of the GIS courses offered in my program. Besides some very light interaction with Python though, their has been zero discussion of ...
3
votes
1answer
492 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 ...
3
votes
1answer
36 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, ...
1
vote
3answers
1k views

converting UTM - Decimal Degrees with javaScript or using a web service

I am creating a wildlife survey form that has a field where users enter location. Users will be able to enter location using a map (i.e. draggable pushpin) or by manually entering lat/lng. My clients ...
4
votes
2answers
250 views

tabbed popup window for Arcgis Javascript

Anyone know examples of a tabbed popup window for Arcgis for javascript, NOT an infowindow? If you could point me in the the right direction it would help.
0
votes
0answers
20 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
16 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
22 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. ...
1
vote
0answers
12 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
0answers
22 views

Perpendicular from a point off a line [closed]

I have a line and I know it's endpoints A,B. I also have a point C that is off the line. AB(lat,lng) = [[58.925863122192126,14.053963925140765],[59.619433091388025,15.92825288189892]] C(lat,lng) = ...
6
votes
1answer
514 views

Why do ArcGIS Desktop 10 HTML popups give JavaScript/HTML Error?

Using ArcMap 10 Desktop HTML Popups. The issue I am having is that the html < select > elements aren't working - you can select it and use the arrow keys to navigate through(up/down) the list but ...
0
votes
1answer
398 views

OpenLayers 3 how to keep original image extent

I'm new at ol3, I'm trying to display my GIS view by updating my ol2 code. I created the projection and I can display my static image but I'm obliged to use local extent [0, 0, 1024, 968] instead of ...
0
votes
0answers
14 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
16 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
16 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
23 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
38 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
20k views

Uncaught SyntaxError: Unexpected token : when using ajax

I try to call json data from geoserver, but when i try to run it in chrome, it return this following error "Uncaught SyntaxError: Unexpected token :" This is my code, function ...
3
votes
2answers
41 views

Vector under OSMbuildings

I would like to display a circle object under the OSMbuildings layer with OSMBuildings . I was trying to change zIndex, bringToBack(), bringToFront() but it doesn't work. I don't use my own GeoJSON ...
0
votes
0answers
31 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 ...
1
vote
1answer
665 views

How to let the user resize a Leaflet map <div>

I use Leaflet to display some map. I would like the user to be able to resize the map by dragging its borders as she likes. I would like to do this without additional Javascript libraries, instead by ...
2
votes
1answer
169 views

Control to select data source on Leaflet map

I am building a map using leaflet. My data source looks something like this: var districts = {"type": "FeatureCollection", "features": [ {"type":"Feature", "geometry": ...
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($) { // ...
2
votes
0answers
91 views

Setting multiple WMS layers over basemap of OpenLayers 3?

I'm developing a web-based application. In this project I'm trying to create multiple WMS image layer over the map with legends. As you can see below its showing the WMS layer over its basemap . ...
1
vote
1answer
573 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 ...
2
votes
1answer
23 views

Mutually Exclusive Bootstrap Checkbox Switches as Layer Control

I have this JSFiddle with two checkboxes using Bootstrap Switch that change 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 ...
3
votes
1answer
183 views

Show Cartodb Maps infowindow on hover programatically

How do i get to show the cartodb infowindow when one hovers over a point? I see that it is possible via the gui but how can one do it via code? what method should i call on the on('featureOver') ...
0
votes
1answer
181 views

Leaflet: Find my “this” in GeoJSON.pointToLayer function

In leaflet, I have a class that extends L.GeoJSON: L.MyLayer = L.GeoJSON.extend ({ initialize: function () { this.markers = []; ... I redefined the pointToLayer method to create ...
0
votes
1answer
46 views

GeoJSON properties not displaying in popup-leaflet GeoDjango

I want to show the markers in different colours based on column(rastervalues) values in leaflet. My geojson data is {'geojson': "[{'type': 'FeatureCollection', 'features': [{'type': 'Feature', 'ge ...