JavaScript is a prototype-based, object-oriented scripting language that is dynamic, weakly typed and has first-class functions.
1
vote
2answers
905 views
How to get GeoJSON features using OpenLayers?
Can anybody explain how to get geojson features .Can somebody show way to get attributes from geojson text.
OpenLayers.ProxyHost = "/gt/proxy.cgi?url=";
var lon = 5;
var lat = 44;
var ...
1
vote
0answers
77 views
How to write addressToLocations onError?
How can I write a code for checking the error condition in Javascript (ArcGIS) for
addressToLocations(params, callback?, errback?).
if somebody entered an invalid address- how can I call error ...
-1
votes
2answers
87 views
Go to the URL on click with GeoJSON
I'm using Leaflet API and geojson. I defined a function which zooms to the feature when clicked:
function zoomToFeature(e) {
map.fitBounds(e.target.getBounds());
}
function ...
3
votes
1answer
580 views
How to set map rotation in ArcGIS Javascript API?
I've created a web map using the ArcGIS Javascript API, but I need my map to have a fixed rotation of 1.76. The street grid of the map doesn't totally align with the cardinal directions, so it looks ...
8
votes
3answers
1k 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 ...
1
vote
0answers
229 views
translating and scaling viewport to fit geojson map in D3js
I am trying to load a map of Rio de Janeiro (Brazil) in GeoJson for with D3js
the code and the map is here:
https://gist.github.com/4157853
I can open the map normally with Qgis, but with d3js ...
3
votes
1answer
201 views
ArcGIS Javascript API - Return 'normal' map extents when panning around the world
ArcGIS Javascript API maps allow the user to pan around the world, which is a great feature, however I am performing some processes that rely on map extents. I have discovered that despite the ...
0
votes
0answers
64 views
How do I determine programmatically what values to add to the proj4js constructor for a CRS or SRS such that I can iteratively render proper overlays
I think this is primarily a GIS based question as far as for example:
var crs = L.CRS.proj4js('EPSG:2154',
'+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 ...
2
votes
2answers
147 views
Insert Javascript code in Popup.FramedCloud?
I would like to have a live stream from a web camera in a Popup.FramedCloud.
All I need to do is to insert this code in the HTML code parameter for popup:
<script ...
2
votes
0answers
129 views
How to use javascript in fusion tables to query
I'm having a quite bit of difficulty creating some functions for my fusion tables. I have two tables here:
Points
Parcels
I'm trying to create a number of functions:
1) I want to be able to select ...
1
vote
1answer
269 views
How do I project my WMS tilelayer in leaflet if I want it to display as an overlay on my basemap if they have different EPSG?
So my basemap is a world Mercator projection and in wfs format and I'm trying to put a WMS overlay in a different projection over it? Leaflet's API didn't give me much info on changing the epsg so is ...
2
votes
0answers
168 views
Openlayers text layer is not working
I am trying to load markers from a text file using openlayers text layer, but no marker is shown, text file and icons are in same directory. However I am able to show markers using marker layer. My ...
5
votes
2answers
2k views
Adding/Removing Leaflet GeoJSON layers
I'm trying to show different GeoJSON layers at different zoom layers using the Leaflet API. I can load and display all three layers at once (though I don't actually want them all to show at once). I ...
-1
votes
1answer
147 views
Map not displaying from Javascript using fusion table
I have this javascript which I am working on but the map in the HTML is just not displaying. I have a similar fusion table with layer_1 which is displaying fine but when I put layer-2 instead of ...
1
vote
0answers
70 views
Layer set visible
I add this layer like this:
var POIData = new esri.layers.ArcGISDynamicMapServiceLayer("https://mysite.com/ArcGIS/rest/services/POI_Data/MapServer");
map.addLayer(POIData);
...
1
vote
0answers
78 views
adding WMS service to application ArcGIS JS api
I've got map in projection: 4326 (WGS-84) when I try to add WMS layers which is in different projection I always get connection timeout Do you know if I could change WMS projection to set it up ...
1
vote
1answer
317 views
Does leaflet support wms tile layers in applications/openlayers formats?
I am trying to create a tilelayer.wms overlay on top of a wfs base map and I wasn't sure whether leaflet allows the applications/openlayers type of format which I served up from geoserver or only ...
0
votes
1answer
46 views
What kind of different results or what is the difference between two URL based WMS requests [closed]
I am trying to retrieve some WMS layers from geoserver so that I can display them in leaflet and I need to populate a URL field and I noticed that many of the layers that I opened up in openlayers had ...
0
votes
0answers
62 views
Javascript tutorial from Flexviewer map to Mobile JavaScript
I want to make some web maps from my private and https server available over JavaScript for all mobile devices. I dont want to use the esri app but just to use the browser.
This because of the ...
4
votes
1answer
253 views
ArcGIS Online without basemap
I am trying to create a Web App, using the ArcGIS Online feature of downloading the javascript code, with the map id being used for connecting to the ArcGIS Online. I was able to do that successfully ...
2
votes
2answers
89 views
Can PHP be used to set the XY, zoom of a Mapbox.js map?
All,
Is there a way to set the xy and zoom level of a map using the URL of the site that is calling it?
I'm thinking of a site I'm using now, built on php, which has mapbox maps built in javascript ...
2
votes
0answers
97 views
How do I format tilelayer.wms url properties such that I add an overlay iteratively to my base map in leaflet
My base map was created using hard-coded template variables. I am using the leaflet tilelayer.wms constructor and including the url like so:
url: ...
0
votes
1answer
70 views
Looking for free sdk/lib/framework for UI for openlayers app
I'm looking for free UI lib/sdk/framework to make openlayers app that I can have the map in one panel , the layer control in other panel and maybe hovering tool bar (instead of putting buttons on the ...
3
votes
0answers
102 views
Is it possible to create filters based on attributes for markers in Leaflet?
I need to create filters based on attributes of markers. I have markers defined this way:
var locations = [
['AB11 5HW','17','A',57.147701,-2.085442 ] ,
['AB11 8DG','3','B',57.129372,-2.090916 ] ...
0
votes
2answers
2k views
How to delete polygon in Openlayers
I would like to delete my polygon in Openlayers after i have drawn it.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
html, body, #map {
...
3
votes
1answer
81 views
is there an API-level error handler in the ArcGIS Server JS API?
I'm seeing an error message in FireBug:
Error: Internal kml parser error.http://serverapi.arcgisonline.com/js.../?v=3.2compact
Line 34
I'm not worried about fixing this error for the moment - I'd ...
2
votes
1answer
562 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 ...
2
votes
0answers
51 views
Features disapearing
When I add a polygon feature it shows on the map. When I add another one the first one disappears. The code for adding is below:
$.postJSON('@Url.Action("GetLayers")', { "planId": planId },
...
3
votes
1answer
361 views
Using PHP and JavaScript to dynamically create shapefile or KML
While I have used GIS software (ArcGIS and just started playing with QGIS at home), I have never looked into the code or file structure of shapefiles.
I am working on a project for my work, a ...
3
votes
2answers
282 views
How to speed up the process of vector data visualization for a web application
I have a GIS web application and vector data that is going from the model to the web application. For developing the User Interface I am using JavaScript and OpenLayers. But sometimes the amount of ...
6
votes
3answers
4k views
Creating a Bing and Google Tile Layer for Leaflet
I want to use the Leaflet Javascript Library to display both a Google and Bing Tile Layer, though I'm unsure how to construct the url. The documentation shows an example using OSM:
var cloudmadeUrl = ...
3
votes
0answers
326 views
leaflet - Drawing line following the road
Short version:
What I wish to be able to do is drawing a polyline along part of a road. In that way marking certain houses, along this road.
Long Version:
I have several houses that I wish to mark ...
1
vote
2answers
252 views
Load One Layer from ArcGIS Server MapServer
I am pretty new to ArcGIS Server and am building a map applications using the Javascript API. I can easily load the map layer below by adding it as a ArcGISDynamicMapServiceLayer
...
2
votes
2answers
124 views
Insert a loading message into DataGrid
I'd like to show a loading message (Loading...) that shows while the datagrid is being populated.
It would show when the search button is clicked and disappear when the grid results have populated.
...
4
votes
2answers
322 views
ArcGIS JS API Edit Toolbar permits MOVE but not EDIT_VERTICES or ROTATE - JavaScript error thrown
I'm putting together an ArcGIS (v10.1) JS API (v3.2) application and I've hit a snag in drawing / editing functionality.
Users can draw a new geometry or edit an existing one. I'm using the draw and ...
2
votes
1answer
268 views
Determine why OpenLayers.Bounds containsLonLat() returns false
In this code, I'm loading a bunch of random points that are roughly in the contiguous USA. I've created a OpenLayers.Bounds object roughly corresponding to that extent.
When I select a point, I want ...
1
vote
1answer
594 views
Add label/text to esri.symbol.PictureMarkerSymbol
How can I add label or text on the ESRI's PictureMarkerSymbol (Javascript API)?
I could use any other marker as well that support labels.
Thanks!!
0
votes
1answer
103 views
Vector data(point) is drawn in wrong place on map (OpenLayers)
I need to show a map (world map, used default OpenLayers WMS) and one point on it (with events like onhover, etc). Here is my code:
var options = {
...
1
vote
1answer
1k views
Feature Layer with ONDEMAND mode
I can't understand how to display all features from the feature layer. In the code bellow I specified 2 features in the layer and set in feature layer's mode to esri.layers.FeatureLayer.MODE_SNAPSHOT. ...
0
votes
2answers
331 views
Toggle Visibility of Features in FeatureLayer
How to toggle the visibility of features in a feature-layer using check-boxes .I have grid containing check-boxes in a columns representing each feature in Feature-layer and so if I check off the ...
7
votes
3answers
659 views
what is the right way to delete all features from featureLayer
I have a feaureLayer and I don't want to kill it and create another one. I want to delete all features from the current featureLayer. I found that I can use applyEdits method but in order ot use it I ...
4
votes
0answers
1k views
How to handle add feature event in the FeatureLayer/Editor
I use a FeatureLayer created from the featureCollection. I also use esri.dijit.editing.Editor to add a feature to the map. Every time feature has been added to this layer I want to send it to my ...
2
votes
3answers
3k 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 ...
4
votes
1answer
744 views
How to change a FeatureLayer's symbols?
I did this:
dojo.connect(featureLayer, "onUpdateEnd", function() {
var defaultSymbol = new esri.symbol.SimpleMarkerSymbol().setColor(new dojo.Color([0,0,255]));
...
7
votes
3answers
394 views
Map Application Requires Refresh to Initialize
I tried this question over on StackOverflow but didn't get any answers. Hoping you all might be able to help.
Creating a web mapping application in Javascript/Dojo:
When I load the app in a browser ...
0
votes
1answer
1k views
Google Map - display specific markers popup using a list of markers
I have the following code:
<script type="text/javascript">
window.onload = function() {
// Creating a new map
var map = new google.maps.Map(document.getElementById("map"), {
...
11
votes
5answers
4k 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 ...
5
votes
4answers
3k views
Google maps kml and polygon eventclick error
I have a google map polygon kml file that I am loading on a google map. When I click on the polygon, I draw a line from that polygon to places on the map. To do this I am using the code:
//Add KML ...
4
votes
1answer
193 views
USGS Topographic Map Online API
I am creating a website for a non-profit organization and would like to plot points on a map similar to this: http://www.arcgis.com/home/item.html?id=931d892ac7a843d7ba29d085e0433465
I am currently ...
3
votes
2answers
314 views
How can several vector layers have different controls, using Openlayers?
Using openlayers I have two vector layers. One layer is called lineLayer consisting of vector lines, and the other is called pointLayer consisting of points. When I hover on the lines I want to be ...


