Tag Info

New answers tagged

0

Google allows you style the map tiles themselves. You won't need the CartoDB API for this. It's not a true "opacity" of the map layer, but you can use the map style to change the lightness of the map tiles to achieve what I believe is the effect you want. Check out https://developers.google.com/maps/documentation/javascript/styling for examples. However ...


1

Hey plain CSS did the trick: .leaflet-container { background-color:rgba(255,0,0,0.0); }


1

solved It: function calculateArcPointsGeo(center, radius, startAzimuth, endAzimuth, segments) { var pointList = [], point, i, d = radius / 1000, // d = distance in km R = 6371, // km, R = earth's radius (mean radius = 6,371km) lat1 = deg2Rad(center.Y), lon1 = deg2Rad(center.X), ...


0

You may try inspecting the object that has your list of items and building a new one containing the single instance of the strings in the old object. This sounds like what you might be trying to do. If not, then please let me know and i will refine the approach, as appose to simply down voting me ;). The idea is to filter your object with duplicates by ...


2

Basically I just set a count attributes as the following codes: data.push( { attributes: {count:commuterAmt}, geometry: { spatialReference: { wkid: 102100 }, type: "point", x: coordXicon, y: ...


2

The basic algorithm is to check every segment of the polygon and find the closest point for it. This will either be the perpedicular point (if it is on the segment) or one of the endpoints. After doing this for all segments, pick the point with the smallest total difference. So in your example it would be the segments: AB, outside, pick B BC, inside, try ...


2

Find the two nearest points to your point; just do this with pythagoras, but don't sqrt, you don't need the distance, only the order. Work out the gradient between these two points (y1-y2)/(x1-x2) where 1 is one of the points and 2 is the other. This is from solving y=mx+c for m for the two points (simultaneous equation). Then use one of these points to ...


0

We had similar problem in one of our projects.We've used open layers 2 modify feature (http://openlayers.org/dev/examples/modify-feature.html) to implement editing topology and it works quite well.You can implement some simple basic checks on the client side (open layer have a good support for working with geometries), but we've decided to do most of them on ...


5

You can get it with JSTS. Check DistanceOp.js.


2

Thanks for the clarification. It appears that you are mixing the ArcGIS JS API's map object with the Google Maps API's heatmap functionality. This is highly unlikely to work. Instead you could look at the ArcGIS Server JS API's heatmap functionality. This isn't officially supported but stands a better chance of working - see ...


2

It does really depend on the project and what type of data you're using (and what you know how to use) but Tom Macwright made this handy simple Map Makers cheat sheet: https://github.com/tmcw/mapmakers-cheatsheet


4

Echoing Bill: it depends. I would say never/rarely do the second option. Keep your data and styling separate. The first and third options might be rephrased as "when should I use a service to render map features?" and "when should I use Leaflet to render map features in-browser?" For me, I try to do the third option whenever I can. Rendering features in ...


1

You are getting an error message from the server back in XML. You can view the message by extracting a tile url being sent to the server. This is easy to do in IE - just right-click on the map and copy the image url. Otherwise use Firebug or the debug tools in Chrome to extract the URL. Then just paste it into the browser directly. I'm not sure why you are ...


8

There's a lot of subjectivity still in play, but I think a broad answer to your question is that it's getting easier every day to use GeoJSON directly in a leaflet map without tiling, and this is ultimately a good direction for interactive maps to be going. As such I tend to build maps using your third option above. That comes with a few caveats. You ...


1

It looks to me like you are trying to use the features array returned by QueryTask when it is empty. I.e. If 'result' is the name of the variable you're using in your QueryTask call back, then result.features is the array of features it returns. You need to check the length of the array, e.g.: if (result.features && result.features.length > 0) ...


0

Previous answer is parcially correct. You have to use a html tag. the easy way to do it, since the content of the featur info window is fetched by geoserver is using a getfeatureInfo template; in the content.ftl you should put someting like : <ul> <#list features as feature> <li><b>Point of interest, ...


1

The following code should work to attach an infoTemplate to a polyline. var infoTemplate = new InfoTemplate(); infoTemplate.setTitle("Your Title"); infoTemplate.setContent("field1 label: w ${field1}<br/>" + "field2 label: ${field1}"); polyline = new FeatureLayer("[Your Rest Endpoint URL]", { ...


0

have you seen this sample? in general, whether you use the TemplatePicker or not, the approach you should take is the same. That is to instantiate a Graphic object using your geometry and attributes and pass the graphic within FeatureLayer.applyEdits(). depending on the argument position of the graphic, this method allows adding new features, editing ...


0

Changed browser from Google chrome to firefox it all works now


0

i dont know the side effects but it fixed, when "olTileImage" override in style.css file that incoming from openLayer.js img.olTileImage { -webkit-transform:inherit; -moz-transform: inherit; -o-transform:inherit ; -ms-transform: inherit; transform:inherit ; -webkit-backface-visibility: inherit; ...


0

Check out my fiddle here, I think this is kind of what you're looking for --- http://jsfiddle.net/mkhines/SZk4u/embedded/result/


1

You would have to store polygon IDs in onEachFeature(feature, layer) handler (e.g. layer._polygonId = feature.id), so later you can iterate over layers (e.g. jsonLayer.eachLayer(function(layer) { setHighlighted(layer, doesRelate(layer._polygonId, selectedId)); });.


0

If you are looking for a data visualization library, check out Highmaps, from the people behind Highcharts (myself included - currently employed as a software developer). It's free for non-commercial use, works great with mobile browsers (full touch support) and old IE down to IE6. Supports advanced dynamic features like drilldown and rich tooltips.


2

Terraformer can parse WKT, and it can project from Geographic Latlong to WebMercator, but it can't write a WKT. However we can build the WKT string from projected polygon. First refer to the terraformer-core and teraformer wkt parser libraries in your code, like this: <script src="terraformer-1.0.3.min.js"></script> <script ...


1

Since you are a student, I will not give you the complete code, however here is a a way to do it: var totallayers; totallayers = map.layers.length; gives you the total number of visible layers So, simply get the Total Number of Layers as above then use a JavaScript Timer to call a function that increments the current layer counter, resets it to zero when ...


0

Thats worked http://www.leafletjs.com/reference.html#events was helpful the code would be: map.on('click', function(e) { tempLatitude = e.latlng.lat; tempLongitude = e.latlng.lng; });


1

The map's default infoWindow should actually be an instance of esri/dijit/Popup, so the way to have it behave as if a user has just clicked on a given feature is to call its setFeatures() method. var point; var query = new esri.tasks.Query(); // TODO: set query paramters var deferred = ...


1

Have you looked at the Basemap Toggle (https://developers.arcgis.com/javascript/jssamples/widget_toggle.html) and the Basemap Gallery (https://developers.arcgis.com/javascript/jssamples/widget_basemap.html) for examples or their widgets? If you use the image you have and assign click events to each 'button', you can change the basemap using code similar to: ...



Top 50 recent answers are included