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)

4
votes
3answers
425 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 ...
3
votes
1answer
3k views

CloudMade Routing with Leaflet: route is not displayed

I am trying to consume the CloudMade routing API using Leaflet. So far, I have managed to pass points and receive a response, and parse that response into an array of points. The array of points is ...
0
votes
0answers
13 views

How can i find shortest point on edge of a polygon from a point to that polygon (not it's distance ) [duplicate]

Point(x,y) may be inside or outside of the polygon ,shortest distance between polygon ABCDE and point(x,y) is marked as red line ,the intersecting point is Point(m,n) .I need the value of m and n I ...
1
vote
1answer
231 views

Using Google Map Spatial Reference to plot HeatMap?

Basically I am trying to plot a Google heatmap based on the JSON objects returned. Here is my JavaScript: function getHeatMap() { var gradient = [ 'rgba(185, 185, 203, 0)', ...
1
vote
3answers
176 views

Popups over markers not working in OpenLayers

I have a map developed based on google map API and OpenLayers. It has some markers on it. I'm trying to create a popup for each marker. The markers are in a markers layers. Besides the markers layer, ...
2
votes
0answers
60 views

How to simulate events from Openlayers 2?

I am working on a GIS API that uses OpenLayers. I am testing it using QUnit. The problem is I need to simulate clicks and trigger some events to be able to test the whole code. For example, I have a ...
5
votes
3answers
219 views

Guidance when to style your features in Tilemill vs. Leaflet?

I've found this generally to be dependent on each project's goals (or what the client wants), but when you have the options, what any rules of thumb or guidelines do use you in a project to determine ...
0
votes
0answers
107 views

Creating a layer switch Google Maps Api v3

I have generated a basic webpage with Visual Studio 2012 that displays a Google Map. My goal is to add multiple KML layers from my Server onto the Google Map, BUT, i want to be able to have a sort of ...
0
votes
1answer
76 views

Syntax for using ArcGIS for Server layer with WMS service?

I am having some issues with getting an image/png format from an ArcGIS Server. The console returns: Resource interpreted as Image but transferred with MIME type application/vnd.ogc.se_xml: ...
0
votes
0answers
64 views

Dojo Stacked Columns Chart for JavaScript ArcGIS Web Map Pop

Anyone know how to use the the StackedColumns chart in dojo for ArcGIS JavaScript API? I need to add one to my popup window. I can only find the documentation below: ...
1
vote
1answer
83 views

ESRI Javascript API QueryTask error handling

I'm struggling to find the proper way to handle errors in a QueryTask. Particularly if the user clicks outside the feature layer. My current QueryTask looks at a field (bare_earth) populated with ...
3
votes
1answer
952 views

How to highlight on mouseover without wiping out select control

I am trying to highlight features of a vector layer as the mouse moves over them. I can make this work. I'm also trying to make the features selectable and have a popup box when they're clicked. this ...
0
votes
0answers
35 views

OpenLayers vector feature not being highlighted

I'm trying to highlight a clicked area of a layer using a vector: var highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", { displayInLayerSwitcher: false, styleMap: mystyle ...
0
votes
0answers
53 views

OpenLayers 2.13.1, how could I make a click, get coordinates, send it to geoserver function?

I am trying to make this very simple function, at the moment I am quite stuck when I have to place the markers as start/end points. I would like to add a marker as start and another as end and then do ...
0
votes
0answers
24 views

Get Web Map Layer Field Value for If/else Statement

I've been trying to read through the ArcGIS JavaScript API but can't find what I want. I have a web map on my page that is based on my my map stored on ArcGIS online. I want to create an if/else ...
-1
votes
1answer
59 views

ArcGIS API for Javascript - InfoTemplate on a polyline

I have a web map with a few points and a single polyline. I have infoTemplate(s) attached to the points and tried to replicate this to the polyline however, I can't get it to work. I looked on the ...
0
votes
1answer
60 views

ArcGIS Javascript API Editing - Create Feature from Geometry Object

I'm interested in passing a geometry object with certain attributes to an exposed feature class for committed edits. Essentially, I want to manually create a new feature without the template pane or ...
0
votes
1answer
45 views

Kml not overlaying onto Google Map

I created a basic dashboard with MVC 4, visual studio 2012, The dashboard displays a Google map. Here is an image of the dashboard: My intention is to be able to take this Kml file: And ...
1
vote
0answers
106 views

Openlayers Map Marker / Popup Behaviour Mobile Devices

Quick overview. i am creating a site with a map using Openlayers and Open Street Maps. User clicks on map and fills out a popup form and submits form. Markers appear at lonlat points where map was ...
0
votes
0answers
9 views

WMC as a permalink

I'm using the permalink control in openlayers but there are limitations in the way it handles map's context. For example if users load an external WMS layer it won't appear in the permalink. WMC has ...
0
votes
3answers
856 views

How to add png image with esri javascript api MapImageLayer Class?

I have a png image that we host that I need to resize and overlay onto a map at specific gps coordinates. Would this be an image class? I can't seem to find any examples that match up with my needs. I ...
1
vote
2answers
133 views

Leaflet highlight feature by ID

I have a map application where: I load polygons as GeoJSON objects I draw all polygons in a single layer I highlight a polygon on mouse hover What I need to do is the following: on mouse hover, I ...
0
votes
1answer
102 views

Reproject WKT Polygon with Javascript

I have a polygon in WKT in EPSG:4326: polygonWKT = 'POLYGON((13.215179443359373 52.588032137196755,13.42803955078125 52.592620721000365,13.454132080078125 52.46897854656702,13.347015380859375 ...
1
vote
1answer
41 views

How do I cycle through the available Overlays and Base Layers using OpenLayers

I would like to have my map cycle through the display of loaded overlays and base layers using Javascript or jQuery. I would like to do this with a delay of 5 seconds between cycling. Does anyone ...
0
votes
2answers
91 views

Simulate a mouse-click inside an ArcGIS Online JavaScript Application

I have a JavasScript application consuming an ArcGIS Online Web Map. I want to open a default popup at a specific coordinate. Is there a way to simulate a mouse-click at that point, or a better ...
1
vote
1answer
60 views

Basemap Widgets

I am looking for a fancy Basemap plugin to use with the ArcGIS Javascript API. Something along the lines of the Basemap Widget (see image below) available in the Flex Viewer would be great. Anyone ...
1
vote
0answers
44 views

How to offset/displace overlapping lines in a web map?

I have a dataset of points representing a To/From status - something like distribution centres and delivery addresses. When the user clicks on a point I'd like to show the relationships between this ...
0
votes
1answer
59 views

Accessing organisational webmap using downloaded Basic Viewer of ArcGIS Online?

I have downloaded the Basic Viewer of ArcGIS Online (AGOL) to my web- and arcgis server within my organisation. Now I want that copied basicviewer to access a webmap on agol that I made accessible to ...
-1
votes
1answer
170 views

Do map services go stale? [closed]

This has happened several times over: I publish a dynamic map service, and then use the JavaScript API to allow the user to select features to obtain attribute information as well as to zoom to ...
0
votes
1answer
60 views

Using a tree menu beside openlayers

Is there an aplication to add tree menu for the map showed with openlayers? I mean show a map on my site exactly how is showing in google earth for example, my layers organized in folder/subfolder, ...
1
vote
0answers
728 views

How can I get all the latitude, longitude coordinates/points inside a rectangular polygon drawn in google maps?

Google maps lets you obtain a valid address by clicking on houses or buildings one by one, but it would be much easier if you could draw a polygon on the map and get a list of all valid addresses ...
0
votes
1answer
55 views

Adding controls to OpenLayers maps - is this good code

I have multiple OpenLayers maps, each map gets a subset of controls that I use across all maps. In the past I have added controls in the traditional way, for each control. var control = new ...
6
votes
4answers
5k 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 ...
0
votes
0answers
691 views

Plot poly-lines between few points in D3+Polymaps

I would like to create polyline on the click of the mouse. I have 4 circles 3 with radius 2 (Lets name it as B,C,D) and 1 with radius 8 (Lets name it as A). Now when I click on the circle A, poly line ...
1
vote
1answer
687 views

Polymaps + D3+ Polyline with different width and color

I am actually working on a project which involves polymaps and D3. I was wondering if you could help me on this. I have 4 locations and I would like to draw a polyline from one location to other 3 ...
5
votes
6answers
2k views

3D perspective on maps in Leaflet, CartoDB?

Are there any JS library out there that would render normal, flat maps (like Leaflet) into a perspective map like this one, on the web: Also, anyone seen anything that could turn CartoDB data into ...
0
votes
2answers
88 views

ArcGIS Javascript API: Get Map Object from DIV

So I am currently writing an application using the ArcGIS JavaScript API, and I want to access the map object that is held inside of my div from a js module I have. I was thinking it would be a simple ...
2
votes
1answer
73 views

FME Server API - Retrieve Output file as a URL

I have a FME Server web workspace converting a file from SHP to KML, once it runs it outputs a kml file, I need to be able to take this file and drop into my web API google Map. Is there a way to ...
0
votes
0answers
31 views

Map Route Direction Zoom to Segment

Basically I am trying to zoom to certain route segment when getting direction on OneMap. Here is the JavaScript codes where I trying to plot a route and zoom to certain route segment: function ...
0
votes
0answers
106 views

How to use Javascript Esri map as GPS Tracking?

I have an android application that get the gps coordinates of the device and stores it in a remote mysql database. I want to use ajax to display the coordinates in a javascript api using esri. I just ...
0
votes
0answers
82 views

Plotting a Route on Google Maps using a string passed to a function as a parameter

I'm trying to plot a route, using Google Maps. I need to be able to pass a string to the function, to build the Polyline. I can do the following and it works fine: var flightPlanCoordinates = [ ...
0
votes
0answers
39 views

Function that returns the coordinates of the searched address

I'm using Java and GMaps4JSF to make an application where the person pesquisaum address that address is displayed on the map. As the code below, but I need to create a javascript function that ...
0
votes
1answer
127 views

Leaflet Custom Control Fails

Why does the myMenu control not respond to a click? var map = L.map('map').setView([51.505, -0.09], 13); L.tileLayer('https://{s}.tiles.mapbox.com/v3/{id}/{z}/{x}/{y}.png', { maxZoom: ...
0
votes
1answer
685 views

dojo/parser::parse() error TypeError {stack: (…), message: “Cannot read property 'toString' of undefined”}

I'm trying to get the overview map example working from here: https://developers.arcgis.com/javascript/jssamples/widget_overviewmap.html in my site. I have two errors. Chrome gives the one above in ...
1
vote
2answers
176 views

Looking for dissolve algorithm for Javascript

I have three adjacent polygons that together make up a larger shape. I need an algorithm that will dissolve the internal borders leaving only the outside border. An example would be a group of ...
2
votes
1answer
198 views

Leaflet rendering TileMill tiles in the wrong order

I'm stumped, and quite a lot of searching has turned up nothing helpful. I'm on the first step of what will ultimately be a map with three raster layers and three layers of markers (with controls to ...
0
votes
0answers
43 views

Finding adjacent tiles in Google Maps

I built a NodeJS API that returns locations and returns paths and stores them locally in MongoDB for fast responses. Also another part of the API is that it returns compositions of tiles ...
0
votes
0answers
19 views

applyEdits method and File on arcgis feature service

I would like to know if it's possible to upload a file through the applyEdits method on a feature service? I have an Oracle database with a parameter "DOCUMENT" of type BLOB. I would like to upload ...
0
votes
1answer
44 views

How get the link or file from uploads forder of feature service arcgis

I have succeeded in adding a file to arcgis server with the upload method of a feature service on arcgis server. But i can't see how to download what i have uploaded to. Do you have any idea on how I ...
2
votes
2answers
74 views

How to insert coordinates to url

What would be the approach to show and dynamically update the map coordinates in the url like stamen is doing it? Are there any built in functions in OpenLayers, what other techniqes could I use or do ...