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

learn more… | top users | synonyms

117
votes
16answers
42k views

How do various JavaScript mapping libraries compare?

I am working on a web-based mapping system and I'm trying to figure out the best/most appropriate library to use. There are a few of them about and they each have pros and cons. Even after trying a ...
11
votes
2answers
2k views

OpenLayers 2.12 and http basic authentication woes

I am trying to use OpenLayers 2.12 to display WMS layers from a server which has HTTP Basic Authentication enabled. I have tried to handle the authentication by putting the username and password in ...
10
votes
4answers
10k views

Overlaying lat/lon points on Google layer in OpenLayers

I'm stuck adding a vector point in lat/lon on top of a Google layer in OpenLayers. The point is moving when I pan the map. This doesn't happen if I replace the Google layer with a layer in WGS84. How ...
13
votes
4answers
3k views

Which framework is best to implement an application robustly, using ArcGIS Server JS API?

Over on the Esri forum, user Matt Moyles suggested that the approach used in the Esri JS samples isn't suitable for robust development of a web mapping application using HTML, JavaScript and CSS: ...
12
votes
2answers
5k views

OpenLayers alternatives supporting more client-side features

I am considering different architectures for a system that will ideally use client-side rendering for point features and must be plugin-free. I have been using this application developed in response ...
4
votes
2answers
6k views

Calculate bearing between two decimal GPS coordinates

I'm building a virtual tour application that uses custom panoramas in conjunction with Google's StreetView service. With StreetView, you can have 1 to n links at each particular location to move to, ...
9
votes
2answers
1k views

Restrict pan and zoom in ArcGIS Javascript API?

I'm creating a web map of a university campus. I have the map functioning, but I don't want to be able to pan off of the basemap, into whitespace. Do you know of a function that will auto-pan the ...
4
votes
3answers
313 views

How can I find closest point on a polygon from a point

I have a point that may be inside or outside of a polygon, I need to find the nearest point on the polygon boundary from the point. Point(x,y) may be inside or outside of the polygon, shortest ...
4
votes
2answers
2k views

ESRI Javascript API: How to hide infoWindow while using measure tool?

In my Javascript API Web application I'm using the infoWindow to query a parcel layer and display display information in a popup when I click the parcel. I've set this functionality to turn on and off ...
3
votes
3answers
6k views

How to dynamically update a KML layer in OpenLayers 2.10?

Arguably, this is a easy question for you guys GIS expert. Here is the question, how to outsource a dynamic KML file using JavaScript in OpenLayers. I want to refresh every 7 seconds. Below are ...
4
votes
2answers
2k views

Identify all layers on the map without pre-designing the infoWindow

This applies to the ArcGIS Server JavaScript API 2.4. The Identify Task sample shows how IdentifyTask can be used to find features in multiple layers, as specified in the IdentifyParameters: ...
2
votes
2answers
1k views

Spatial query in ArcGIS Javascript Api 3.1

I have scenario in which I have to select features drawing a polygon and and get the attribute values in to a tables or lists.The features on the map consist of polygon, line,point at the same time so ...
2
votes
2answers
1k views

How to skip drag event to stop a feature being dragged

I am new to OpenLayers and I'm trying to drag markers and skip some markers from being dragged, I've tried dragFeature.deactivate(); it will deactivate entire features please help me. Please check ...
2
votes
1answer
627 views

Syntax of WFS request in OpenLayers

I am in need of the correct syntax for loading WFS layer using OpenLayers. I have gone through many examples on the OpenLayers site and other examples, but can't figure out how to use the necessary ...
2
votes
4answers
7k views

How to use Google Maps V3 Geocode with Openlayers

How to use Google Maps V3 Geocode with Openlayers. Below is my code but the function does not execute when I try to integrate it with Openlayers. This works with my original google v3 file. Below is 2 ...
1
vote
2answers
559 views

OpenLayers.Class with OpenLayers.Control.GetFeature

I'm wondering if someone could point me in the right direction to force the BBOX of OpenLayers.Control.GetFeature to be always in long/lat coordinates. I'm trying to get this with OpenLayers.Class, so ...
1
vote
1answer
564 views

Unproject Radius with Openlayers with CRS:84 Projection

I have made a Openlayers integrated map that lets you draw a circle, On completion of the circle I have told the map to give me , Bounds, Center Long and Lats, and lastly the radius. My problem is ...
1
vote
2answers
518 views

How to prevent automatic new line when labeling point feature class?

I have a point feature class that I am labelling with the string "EXIT" for a majority of points, but some points will be longer, such as "EXIT into Pacific". I wrote a labeling script that will ...
13
votes
6answers
6k views

Pure JavaScript Library for Geometry Operations

Does anyone know of a pure JavaScript library for doing geometry operations such as buffer, union, intersects, etc? I want to play with doing these operations in the browser. It looks like ...
7
votes
1answer
5k views

How to Add/Remove Legend with Leaflet Layers Control?

I have two overlays http://02d0c8c.netsolhost.com/dev/lcb_census_layers3.html that can be turned on and off with a Layer Control. I’d like the legend for each layer to turn on/off along with the ...
7
votes
2answers
10k views

OpenLayers: Use scales instead of resolutions

Venturing around in the OpenLayers source code, it seems like everything related to zoom-levels is done using resolutions. Fair enough since this related directly to screen space. I would like ...
8
votes
5answers
11k views

OpenLayers - redrawing map after container resize

In my web application, I want to enable users to set the size of the map container. Everything worked fine when the container was expanded slightly (apparently this is because the tiles that were ...
4
votes
4answers
4k views

How to load external geojson file into leaflet map

I would like to load a geoJSON (polygon) file into my leaflet map. I have seen examples where geoJSON is embedded into the javascript code but I can't find any examples showing how it is done with an ...
4
votes
1answer
2k views

How to draw Geodesic lines in Openlayers?

Hi i want to display multiple lines between two coordinates. i will pass no of lines and color of the line, it has to display like below image. please see the below image.this is my previous post
3
votes
3answers
1k views

How to add a polygon from PostGIS ST_AsGeoJSON into Leaflet?

I try to use the following function to add polygons to my Leaflet map. function polygon(geojson) { alert(geojson); // alert for testing layer = L.geoJson(geojson); layer.addTo(map); } ...
3
votes
1answer
4k views

SelectFeature with Double-Click

I have the ability to select features on the map with a click using OpenLayers.Control.SelectFeature. How can i add a double-click handler to that? I have tried modifying this code to suite my needs, ...
1
vote
2answers
5k views

Sending xml post request to geoserver

This may be simple question but I can't get started. This tutorial from pen state university has xml request <wfs:GetFeature service="WFS" version="1.0.0" outputFormat="GML2" – we would like ...
1
vote
1answer
3k views

Openlayers get coordinates of a circle vector after draw

I have made a openlayers map. I have made two features on the map. Navigate DRAW POLYGON I have made 40 sides to my polygon which turns out to be a circle. After I have drawn my circle I want to ...
8
votes
2answers
2k views

How to resize a point on zoom out?

I've added a point on map like this but it is static in size. How to resize that point on zooming? Map on zoom out Any guidance and help is appreciated.
8
votes
3answers
2k views

Mobile offline mapping and editing of shapefiles

I've got a client that wants to create a mobile app that can view and edit shapefiles stored locally on the device to enable it to work offline. There is a possibility of converting the shapefiles to ...
7
votes
3answers
1k views

CORS issue ArcGIS 10.1 IIS (Cross Origin Resource Sharing)

I have ArcGIS 10.1 installed with the web adapter for IIS. I've added a config file to the root of IIS7 to enable Cross Origin Resource Sharing (CORS) as per this page. I've pushed the cors enabled ...
5
votes
2answers
825 views

Moveable ESRI / ArcGIS Identify Popup Window (Dojo)

I'm trying to get a popup window that identifies a location to be moveable. My code is similar to the API example: var popupOptions = { fillSymbol: new ...
4
votes
3answers
5k views

Using the Proj4js library to convert from Google Maps to projected values

I'm using the proj4s javascript library (based on advice from this question I asked previously) to convert lat/long values on my webpage. This page receives the lat/long values from google maps and ...
3
votes
2answers
1k views

Zoom after apply CQL_FILTER in OpenLayers

I apply a filter to one layer and works nice. I want to maximize the bounds where I applied the filter, like this: // mapbounds = array(minx,miny,maxx,maxy) activeLayer = new OpenLayers.Layer.WMS( ...
1
vote
2answers
3k views

How to initialize a WFS Layer?

Here is the code block (the layers are stored in Oracle database): var saveStrategy = new OpenLayers.Strategy.Save(); var adresspt_wfs = new OpenLayers.Layer.Vector("Address points WFS", ...
6
votes
2answers
361 views

Rendering huge amount of points

Evening Guys, I am new to ArcGIS, and currently developing a small app that uses ArcGIS Javascript API. I have encountered a couple of problems while working on this and would greatly appreciate if ...
6
votes
1answer
1k views

Add a OpenStreetMaps road data layer on Google Maps API v3

I've successfully embedded a Google Maps API v3 map on my site, and added OpenStreetMaps (OSM) as the base layer. Is it possible to use Google's tiles as the base layer, and then overlay street data ...
5
votes
2answers
2k views

Turn Popups On/Off in ArcGIS Online Webmap via Javascript API Web Application

I am writing my first ArcGIS Javascript API web map application and consuming a web map authored in ArcGIS Online. The ArcGIS Online web map apparently does most of the work for me in terms of ...
5
votes
1answer
406 views

Unclear on proxy used for AJAX in Javascript

I do understand how the proxy helps in transferring the XMLHttpRequest between the ArcServer and the Server (IIS/Apache) but where I am confused is that the first time the Html Doc loads, doesn't the ...
3
votes
1answer
1k views

Problems with gxp Print plugin via opengeosuite sdk

I am trying to import the print plugin within an application built using the Opengeo Suite sdk and I have run into issues as is described in the following thread ...
3
votes
1answer
2k views

How can GeoJson polygons be colored programmatically using OpenLayers?

I'm experimenting with dynamically setting the color values of a geojson polygon. In my geojson file, there is an attribute for each polygon called pop_den. I am trying to update the fillcolor of the ...
3
votes
8answers
10k views

How to create an interactive map with jQuery and HTML?

I want to develop a map in JQuery and HTML. It needs to show world country borders. It must be enabled mouse hover effect and also popup (when mouse over) in which I can add my own text. What JS ...
3
votes
3answers
5k views

FeatureLayer creating in javascript ArcGIS API

I got the sample called "Feature Layer with ONDEMAND mode" in the ArcGIS for js resource center. This example just adds layer with rivers to the map. I want to use my own features instead of using ...
2
votes
1answer
193 views

Application for online overlay images on Google Maps

I want to develop javascript app which will take any image user uploads, user will click on 3-4 points on the image (3-4 cities, for example NY, Chicago, LA and Miami) and image will be overlayed on ...
2
votes
1answer
933 views

How to unproject coordinates on a Google map with Openlayers?

Below is my code and a pic. When I finish making my circle on a Google map with Openlayers, I get the following coordinates but I want coordinates like E.G: bottom: -27.762124575762 left: ...
2
votes
2answers
2k views

Querying MapServer using WFS functionality

I'm trying to display a shapefile using OpenLayers and Mapserver. Instead of overlaying it as a png, I want to return a vector, in this case a KML file. My HTML file (located in the same folder as ...
2
votes
5answers
2k views

Convert geographic coordinates to UTM zone 29N with Javascript

I have an issue converting lat longs to UTM with the ArcGIS javscript API. Lets say that I have a map, based on the UTM zone 29N, also known as WKID 32629. I have a known set of coordinates from a ...
1
vote
1answer
88 views

Problem with using a circle as polygon for querying PostGIS

I'm trying to query PostGIS and find some object features that intersect with a circular buffer created by the user using OpenLayers, JavaScript and PHP. I use the following code for creating the ...
1
vote
1answer
153 views

Can individual feature properties be retrieved from the CartoDB.js API?

I'm building an application that uses CartoDB to show users how a proposed redistricting plan would affect them. The user enters an address and that fires a ST_Intersects query to CartoDB, the result ...
1
vote
1answer
3k 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 ...