Tag Info

New answers tagged

2

See code example Leaflet users map https://github.com/bmcbride/leaflet-users-map by Bryan McBride. There is used SQLite DB, but her easy replace on MySQL.


1

function clearMap() { vector_layer.getSource().clear(); if (select_interaction) { select_interaction.getFeatures().clear(); } } I hope that helps you!


1

Your code: Wont work because 'Incidents' isn't defined yet (hence your error message). Try running it without the 'Incidents' in here. Or drop your code into this section: function showIncidents(ajxresponse) { lyr.clearLayers(); lyr.addData(ajxresponse); } Something like this: function showIncidents(ajxresponse) { // Incidents geojson layer ...


0

The HTML does break when you change regions in the 'ArcGIS Portal Directory'. To fix this you hopefully have your original HTML with proper formatting.. paste the SAME HTML from the text editor back into the 'My Organisation' general and home page configuration settings. The settings then need to be saved after both of the HTML areas are updated and then the ...


0

// dojo.require("esri.map"); // dojo.require("esri.dijit.Popup"); require ([ "esri/map", "esri/dijit/Popup" ], function ( Map, Popup ) { ... dojo.ready(init); });


0

When you're declaring your layers you can simply add a 'layerType' attribute from which you can later use to add and remove layers as a group. var birmingham = new ol.Feature({ geometry: new ol.geom.Point(ol.proj.transform([-1.900878, 51.483952], 'EPSG:4326', 'EPSG:3857')), name: 'Birmingham', layerType: 'layerOne' }); When declaring your ...


0

Turf is a javascript library providing a lot of spatial operations. It is also modular, so you can only include the functions you need in the final script.


0

You're not using a valid callback for the onDone, as it doesn't contain the vis object, so the maxZoom setting is not really being applied because the object to apply it is not there. :-) You can use: .on('done', function(vis, layers) { instead. HTH!


2

The 4.0 beta 1 does not support KML. The KMLLayer will be supported in a future beta version. Beta 1 only supports the modules documented in the API Reference.


1

Yes, you can! Actually I built something similar in this example some weeks ago (the basemap switcher doesn't look great, but the functionality is there): http://bl.ocks.org/iriberri/08abc420a376053c71d4 You can just save the basemap layer into a variable and change its _url parameter. Then, just redraw it: ...


0

Several things seem to be wrong in your code. When you have forms inside a Leaflet popup, you want to avoid form submission in the classic way. You typically need to submit using some AJAX behind the scenes that prevent reloading your page. In order to do this, you need to prevent the default behavior for form submission. This question discusses how to ...


3

POLYGON((-90.89 46.67,-90.89 46.67,-90.89 46.67,-90.89 46.67,-90.89 46.67)) Looks like WKT. If it is, you can convert features/layers/geojson to WKT using Wellknown or Wicket-Leaflet


0

What finally worked for me is adding the following to the ROOT site and NOT the application for the web adapter. Does it make sense? Not to me. But it worked for me. <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <httpProtocol> <customHeaders> <add ...


1

Try out this tutorial, someone got stuck with a similar problem and wrote some code to get around it http://spatialnotes.blogspot.com/2010/11/capturing-right-click-events-in.html


0

I tried to check if my MapBox data is ok and I tested the code in Plunker: L.mapbox.accessToken = 'pk.eyJ1IjoiZm5ldmlzdGljIiwiYSI6IkZyYy03U28ifQ.tI5Od3maJWFflOMcit5vDg'; var map = L.mapbox.map('mapbox', 'fnevistic.n7o8oi8c', { 'center': [45.25, 18.55], 'zoom': 12 }); Everything is working fine. Map is displayed, pop-up is working. Now I'm trying ...


0

This is the best possible one i came up with and its working. var lineSymbol = new OURAPP.esri.CartographicLineSymbol( OURAPP.esri.CartographicLineSymbol.STYLE_SOLID, new OURAPP.esri.Color([255,0,0]), 2, ...


1

You can accomplish this using the following: L.mapbox.tileLayer('https://{s}.tiles.mapbox.com/v4/YOUR_MAP_ID/{z}/{x}/{y}.png?access_token=YOUR_ACCESS_TOKEN') All you have to do is replace YOUR_MAP_ID and YOUR_ACCESS_TOKEN in the above snippet.


0

I was able to draw a line and add it to the graphics layer using the following. The [-XX.XXXXXXXXXXXX,YY.YYYYYYYYYYY] is a random point on the map, Now only thing left is to find a point on a circle. So now the question becomes how to find a point which is X miles from a known point(Center of the circle) along the same latitude. ...


0

It looks like you've gotten thrown off track by the example you were following, which uses an old version (7.0.9) of the noUIslider library. The new version that you've included in your code (8.0.2) has different syntax for many operations, as described here. You should be able to get it working by changing one line, from range = $("#slider").val(); to ...


0

Jonatas' answer works great. If you're using the goecode autocomplete, use the 'select' event instead of the 'found' event. Here is how I place a marker for the geocoded result: var geocoderControl = L.mapbox.geocoderControl('mapbox.places', {keepOpen: false, autocomplete: true}); geocoderControl.addTo(map); geocoderControl.on('select', ...


0

I have not found the class ol.source.GeoJSON, and could not find a case where vectorSource.getState() != 'ready'. So I ended up doing something like this: // Toggle spinner on layer loading layer.on('change', function() { spin(); }); layer.getSource().on('change', function() { spin(false); });


0

Literally the stupidest of problems. Forgot to include the layer in the url. As the documentation clearly points out, the URL format works like this: http://localhost:<port>/<layer-name>/<z>/<x>/<y>/<route-name> With that small change, I now have it working on my Mapbox.js map without any problems.


0

Be implemented with Java and layer tree node and primeFaces component.


0

I guess one way to do that is using a setTimeout function. Placing the second call to flyTo() inside setTimeout would delay its execution by certain seconds and we can see the flight to second destination


2

If you mean to disable panning, here's how: First declare your map variable: // Create a map in the div #map var map = L.mapbox.map('map', 'example', { minZoom: 2,//need to change it to 1 maybe 0 for mobile devices // These options apply to the tile layer in the map. tileLayer: { // This map option disables world wrapping. by default, ...


2

function getStyle(feature, resolution){ var style; if (feature.get('field_6') === '4') style = new ol.style.Style({ image: new ol.style.Circle({ radius: 6, fill: new ol.style.Fill({ color: 'rgba(20,150,200,0.6)' }), stroke: new ol.style.Stroke({ ...


0

It may be easier to create the polygon in the Google Earth (not API) software, and then save it as a KML. This is because there are specific tools that allow you to save, edit, and export KML files within the Google Earth standalone software, but not in the API. All the API can do is allow some of the functions that Google Earth offers to be performed by a ...


2

You can do this using a style function (see also the OL3 Example on Earthquake Clusters for a more detailed example of a style function - or search this site!). In your case, partial code would be along the lines of: var myStyleFunction = function(feature, resolution){ var field_1 = feature.get('field_1'); if (field_1 == "PENYEDIA AKOMODASI"){ ...


1

This way: var deleteFeature = function(evt){ if(evt.keyCode == 46){ //delete key pressed //delete feature } }; document.addEventListener('keydown', deleteFeature, false);


0

Ok, so in the absence of a better solution, I'll just cut the parts I want and rearrange the hierarchy. var kml = "<kml xmlns='http://earth.google.com/kml/2.0'>"; kml += "<Folder><name>My export</name><description>Some description</description>"; var layerString = ""; // Write features into a KML string for (var i = ...



Top 50 recent answers are included