Tag Info

New answers tagged

0

Can you verify that the URL strings that the CesiumTerrainProvider is trying to access are accessible. This is probably a simple path problem.


0

@comments If you cant set a Parameter 'slider: false' for the Basic layer group (you are using map.getLayerGroup()) then you should just set the slider for all layers true resp. false/undefinded for the ones who shouldn't have a slider. After that switch the If-statment. var slider = layer.get('slider'); var name = layer.get('name') ? ...


0

I think you are looking for the UniqueValueRenderer, which will allow you to symbolize features by attributes. https://developers.arcgis.com/javascript/jsapi/uniquevaluerenderer-amd.html#uniquevaluerenderer


0

I never actually was able to use L.mapbox.featureLayer for this. I ended up having to use Leaflet's L.geoJson, adding featureLayer to map instead of the featureGroup, and adding the layer to the featureGroup at onEachFeature. Here's what my final code looked like: var featureGroup = L.featureGroup().addTo(map); if (oldData) { var featureLayer = ...


0

You could just pass the pointToLayer function as an option on layer instantiation. var layer = L.myLayer(geojson, { pointToLayer: function (ftr, latLng) { return L.marker([latlng.lat, latlng.lng]); } }); And then get markers off the layer instance. var markers = layer.getLayers();


0

WAB works only with web maps (as default), so you cannot consume AGS services directly - good to know. So you would need AGOL organizational account to access the WAB and deploy your apps. Do you have one? You would need to share all your services you plan to access via AGOL (embed them into web maps, in other words). It is possible to consume AGS services ...


0

After some further research i find out that it's the best way and maybe the only way to get the Buttons to work is to stuck them into a which was cleared every time the Menu was copied into the Floatingpane & destroys the Buttons and setup them again when the List is build in the FloatingPane with all the code. Same backwards.


0

There might be a folder in webApps where you had placed your terrain files. By saying this 'localhost:8081' you mean to say all my files are placed in WebApps root folder. Create a folder place all terrain files in it, append folder name to after port with slash and give it a shot.


1

I have an example here that uses window.open: You can enable the description column in your infowindows in order to retrieve the data from there and avoid the SQL query. layer.on('featureClick', function(e, pos, latlng, data) { cartodb.log.log(e, pos, latlng, data); window.open(data.url); });


0

You can get -- feature.get('any') -- any geojson property and show in the popup. Take a look at this demo. You mixed up some points. So, first, get the coordinate to position the popup: var geometry = feature.getGeometry(); var coord = geometry.getCoordinates(); Note, there is no coordinate transformation. Second, prepare the popup content: var content ...


0

Because you're using the KML inline, as opposed to an external source file, then rather than using the url option (which instructs the source to use a loader) you can just use the features option. See http://openlayers.org/en/v3.6.0/apidoc/ol.source.Vector.html Try something like var vector = new ol.layer.Heatmap({ source: new ol.source.Vector({ ...


1

When you're building the layer tree you need to check the layer.getVisible() value and assign the correct eye icon. See the example below: http://jsfiddle.net/arcf7k77/2/ Alternatively, you could use something like knockout or angular to support the binding. Further to your comment, in order to persist the eye icon state recursively, you would need to ...


1

You have two issues. First, it is Point not point in the GeoJSON, ie, it is case sensitive. You can always use GeoJSONlint to check for the validity of GeoJSON, though it also shows up as an error in the developer console. Second, your link the cdn for the leaflet.css, needs to have the http: in front, ie, http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js -- ...


0

Try adding return before L.CircleMarker just as you have with markers. Without that I would guess layer is undefined.


1

The standard way to do this is to use setTimeout inside a function and call that function recursively, incrementing any values you need inside the function, rather than using setInterval. This allows you to pass variables into the function being called recursively, to either vary the calling interval or some other value, such as a lookup into an array, a ...


0

first, disable the spiderfy and zoom effects: markers = new L.MarkerClusterGroup({ spiderfyOnMaxZoom: false, showCoverageOnHover: false, zoomToBoundsOnClick: false }); then add a clusterclick event listener and construct a popup for the cluster. This assumes you have added name to each marker when constructing the marker cluster (see ...


0

Here is how I am able to make it to work--at least on the local development environment. As I had mentioned in Update 2 in the Question, I started using a NET Proxy. So I created Tokens for allowed IP (which would be web server). Also created a proxy.ashx and in that, importantly, entered 'accessToken' attribute. Then, in my javascript code, calling this ...


0

According to the documentation, leaflet-pip returns: An array of polygons in which the given point resides, an empty array if there are none. whereas you are looking for the opposite: to test if the given point resides in the selected polygon In principle, you should be able to do this with turf-inside. Rough example: var point = turf.point([lon, ...


0

In case someone else runs into this in the future, the issue was the map itself. For whatever reason, there is a bug in the kartograph.py framework that generates SQG maps with incorrect coordinates. My bubbles were not showing up because the longitude and latitude were not present on the map. When I regenerated my map using the laea projection, it worked.


1

this works for me: function bindNewPopup(){ this.bindPopup(randomText()); } var marker = L.marker([47.16, -115.32]) .on('click', bindNewPopup) .addTo(map); The code in your gist only gets a randomText() when the marker is created. To change the text on every click, you need some way to call the function again; therefore create the ...


0

It works to specify default style for all vector classes before you instantiate any: var myStyle = { color: '#00767C' , fillColor: '#00767C' , opacity: 1 , fillOpacity: 0.5 }; L.Path.mergeOptions(myStyle); L.Polyline.mergeOptions(myStyle); L.Polygon.mergeOptions(myStyle); L.Rectangle.mergeOptions(myStyle); L.Circle.mergeOptions(myStyle); ...


0

You have to add a getFeatureInfo-Control: http://dev.openlayers.org/examples/getfeatureinfo-control.html Here's a question about how to add images in the GetfeatureInfo-Response How to Add image and hyperlink along with GetFeatureInfo Popup? How to Add image and hyperlink along with GetFeatureInfo Popup? Some more information about Geoserver's ...


3

It seems you re mixing some concepts features[i] = new ol.format.GeoJSON( url: './testData.geojson') }; The above code can't work because the ol.format.GeoJSON API does not accept url as a parameter eg the official doc. You also try to loop on a GeoJSON call (if I consider above sample was intented for this) The normal way (there are more than one) ...


0

If I understand you correctly then this problem is called map matching. And e.g. our library in combination with GraphHopper solves the problem fast and in many cases already.


0

Had the same problem and finally found the answer (not sure where). Here's what worked for me: var ovProj = ol.proj.get('EPSG:3857'); ... source: new ol.source.ImageStatic({ url: "images/MAP/DYNAMIC/T_1.png", imageSize: [1239,748], imageExtent: [-14483048.340, 2291674.487,-6775420.041, 6947393.399], projection: ovProj }) ...


0

I found the solution : var search = document.getElementById('suche'); search.appendChild(new L.Control.GeoSearch({ provider: new L.GeoSearch.Provider.OpenStreetMap(), }).onAdd(map));


1

Overwrite the defaults in L.Path with: L.Path.include({options: newDefaultStyle}); e.g.: L.Path.include({options: { color: '#dd8855', fillOpacity: 0.5 }});


0

Here's an example using OpenLayers version 3.6.0 http://jsfiddle.net/t3n55fzq/ This is the part that allows you to reproject features during read. var originalSource = new ol.source.Vector({ features: ( new ol.format.GeoJSON()).readFeatures(geojsonObject,{ dataProjection:'EPSG:4326', featureProjection:'EPSG:3857' ...


0

You can adjust the map's view to fit an extent with: http://openlayers.org/en/v3.6.0/apidoc/ol.View.html#fitExtent Use getExtent() to retrieve your layers' extent: e.g. http://openlayers.org/en/v3.6.0/apidoc/ol.source.Vector.html#getExtent See Tim's answer at http://stackoverflow.com/questions/30121024/openlayers-3-zoom-to-combined-extent


0

You try to add an image layer, but your request states getCapabilities (the service description document). You probably mean GetMap ? I donĀ“t understand your url (It does not look standard WMS to me), but I would try something like url : 'http://localhost/cgi-bin/mapserv.exe', layers: 'villages' parameters:{service:"WMS", version:"1.1.1", ...


1

I'm not quite sure I understand what the known X,Y values are, but if you have an start and end lat/long pair and you just want to break it into n segments there are a few different paths you can go depending on what your use case is. Personally I would use the movable type's Lat/Lon library. Calculate the distance and bearing/heading. divide up the ...


2

It should work if you replace "www.google.com" with 'http://www.google.com' (note the single quotes). var link = "<a href='http://www.google.com'>Google Office</a>"


0

I have tested it with Zend Studio and it works, so I guess it will also work with other IDE's, that can interpret the JSDOC3.


0

That's possible using a plugin for leaflet. Take a look on this one https://github.com/heigeo/leaflet.wms You'll be able to display a popup containing attributes for each feature of a wms layer, thanks to the GetFeatureInfo


0

I am using the answer above in a leaflet map to allow users to send me feature requests based on the clicked location in a map, which then opens a pre-filled google form with the lat long from that position. Those points are then shown on the map using sheetsee/tabletop. I added a map.hasLayer(my requests layer) so the user is not always seeing the popup ...


1

There are two possibilities I found (I have had the same problem). For the first one, the answer on top help. I was trying to do it as you did, without using the <script> tag to load the files, but if you do so, it works. Declare each JSON file using the <script> tag: <script src="JSONFILE-1.js" type="text/javascript"></script> ...


0

You should take a look at this plugin : https://github.com/heigeo/leaflet.wms It allows you to get info on a popup for each 'feature' of a wms layer.


0

I modified the code in this as per told in previous answer but it is still giving me error of "Unexpected identifier". MapServer Simple Viewer </head> <body> <div style="width:800; height:800" id="map"></div> <script defer="defer" type="text/javascript"> var perimetro = new ol.layer.Image({ source: new ...


0

drawControl = new L.Control.Draw({ draw : { position : 'topleft', polyline : false, rectangle : false, circle : false, polygon: { // polygon draw options here }, marker: { // marker options here } }, edit : false }); map.addControl(drawControl); see here ...


0

You just added variables breaking the normal OpenLayers 3 behaviour and also made a mistake about extent position Remove mode : 'map', CRS : 'EPSG:3857', Move extent: [8046840.710000,3906011.335000,8217827.220000,4076997.845000] from ol.source.ImageWMS to ol.layer.Image options block


0

Simplest solution is to use ArcGIS Online, they allow you to upload and plot your shapefiles. Though I'm guessing by the way you phrased your question, you want to build the map and interface around it yourself and you don't have ArcGIS for Server. In that case, one way to do it would be to build an intermediate service that takes the uploaded shapefile and ...


0

you can't just pass an object literal as a SpatialReference to the query parameter. point.spatialReference = { wkid: 32367 } // should be point.spatialReference = new SpatialReference({ wkid: 32367 });


0

you can find an extension for the JSAPI to load native GeoJSON in Esri's Github organization. hope its helpful! https://github.com/Esri/geojson-layer-js


1

use the locate event emitted by the widget as your opportunity to get a reference to the geolocated coordinates. geoLocate = new LocateButton({ map: map }, "LocateButton"); geoLocate.startup(); geoLocate.on('locate', function(evt) { console.log(evt.graphic.geometry); }); pass this geometry in a spatial query to your ...



Top 50 recent answers are included