Tag Info

Hot answers tagged

10

Use the OpenLayers.Format.WKT class. Try replacing this line: var fea=new OpenLayers.Feature.Vector(data); //this doesn't work For this line(if data.d = "POLYGON((516000 ..."): var fea = new OpenLayers.Format.WKT().read(data.d); Here's an example on how to use it: http://openlayers.org/dev/examples/vector-formats.html


7

GeoServer has its own convention for JSONP callbacks, which is described here (coudn't find it mentioned in the official docs). So I quickly hacked a jsfiddle showing how you can use it with jQuery, just remember to set the url, workspace and layers so that they point to your geoserver.


6

You have to explicitly specify a width and height to your #map container : In css add : #map { width:600px; height:400px; } Or in HTML : <div id="map" style="width:600px; height:400px;"> And you will see correctly your map!


5

Essentially, you are just passing an array to the autocomplete widget. If the data is in a map or feature service, query for the data from the service. If you start with a table in your mxd/msd that contains the data, when you publish it, you will get a REST endpoint for the table to query for in the same way. Next, parse out the data and push onto an array ...


5

Try this instead: function getJson(simp){ //Removed unneeded arguments here var url = 'file' + simp + '.json'; map.removeLayer(geojsonLayer); //geojsonLayer.clearLayers(); I don't believe this needed. $.getJSON(url, function(data){ geojsonLayer = L.geoJson(data, { style: defaultStyle, onEachFeature: ...


5

You have two options: hook into the create event to adjust layer opacity as sliders are created provide a global cfg array so that layers are already init'ed to same value as the sliders The first solution is simple, just provide a create: function(event, ui) { ... } as an init option to the slider like the following: $( "#slider1" ).slider({ [...] ...


4

The C# part of this question is a duplicate of Is there a free .Net library to convert OSGB36 to WGS84? The answers list two free libraries.


4

You are almost there. Another .each for val.properties should work: $.each(data.features, function (key, val) { $.each(val.properties, function(i,j){ items.push('<li id="' + i + '">' + j + '</li>'); }) });


3

To complete unicoletti's answer. You can have a look on opengeo workshop. There is an example combining openlayers and Jquery UI slider. The full OL tutorial is available here.


3

Yes, many people do use JQuery Mobile together with their choice of mapping API. I use both google maps and ESRI's JavaScript web mapping APIs with JQuery Mobile. If you are planning on doing it with the Google Maps v3 API here is a great set of examples.


3

Please put your code, or a short version, at http://jsfiddle.net/ so we can play with it. Also try: <div id="map"></div> <div id="makeMeDraggable"></div>


3

The "map.setExtent()" method should work in this case. This method will take your coords and center the map over them. else if (RegionID == 2){ var xmin = '-9323482.962110244'; var ymin = '4350184.153764758'; var xmax = '-8922341.437669657'; var ymax = '4557481.374474147'; var regionname = 'Far Sourthwest'; map.setExtent(xmin, ymin, ...


2

See this DEMO. I've recreated your code in the DEMO and it works fine. Without the complete source it's hard to tell what is causing your problem. Your code was throwing an error and was easily fixed by doing what Vadim mentioned: "switch last 2 statements". I have a feeling it has something to do with the source of rPoly(reading from KML). Because that's ...


2

Switch last 2 statements. Add to map first, then activate.


2

An OL extension has been coded for that. You will find a blog post relative to the draggable behavior and the extension implementation : http://aamirafridi.com/openlayers/openlayers-draggable-popups With a link to the demo : http://jsbin.com/agopa3 The extension full code is available on the blog page. Hope it helps.


2

Use .on() instead of .live() - the element is not onpage when you bind your event handler, so you'll need to bind it dynamically. $('click', 'a .smallPolygonLink', function(e){ console.log("One of the many Small Polygon Links were Clicked"); });


2

more of a jQuery question, but try: $("#reset").on("click", function(event) { DNPA_camping.setVisibility(true); DNPA_camping.redraw(); }); edit: or to drop the "reset"-button and have the dropdown make the map show all when selecting all: $("#camping").change(function () { DNPA_camping.setVisibility(true); if ($(this).val() === "All") { ...


2

try something like this, where #plink is where ever you want it on the page $("#plink").append("Link to this map"); map.addControl(new OpenLayers.Control.Permalink("permalink",null, { "createParams": myCreateArgs, title: "right click for link options" })); // check if we were called with permalink args var args = OpenLayers.Util.getParameters(); if ...


2

After you move the map's element (probably a div), call map.reposition().


2

I also understand that the $("#"+layer) is not the layer, but a jQuery object which maybe does not have the properties setVisibility Well, it definitely doesn't have setVisibility because it's a DOM element (e.g. an HTML div), not an OpenLayers object. If you only have one OpenLayers layer you can simply use its reference: if ($(this).is(":checked")) { ...


2

Try something like this. You may be trying to do to much. I have activated the control on startup, as you have. I also just ran a little test and could see good results in my console. Let me know if it works. var format = "application/vnd.ogc.gml"; ctrl_getfeatureInfo = new OpenLayers.Control.WMSGetFeatureInfo({ url:my geoserver, layers: [mylayer], ...


2

After you have done the request you already have the data so you don't need to use d3.json, just feed the data to a selection and work with that. On d3 you can bind data to a selection (usually data is a javascript array, in this case could be data.rows), and then use that data to create your pie graph as in this example. So something like: var piechart ...


1

You can just use a query task from the javascript api to query the map service to get the information so you can then compare the usernames and password and you will not have to use jQuery. There are some security implication associated with this of course.


1

You need to call the resize() method on the map object if you change the size of the map div in javascript.


1

Well I see two issues. The first issue is that in the while statement you are using "lon" instead of "lng" like you defined in your data. {lat: 33.5363, lng:-117.044, count: 1} Here is the typo: new OpenLayers.LonLat(data[datalen].lon, data[datalen].lat) So longitude is NaN when you try to load it, discovered this debuggin with firebug. The second ...


1

Before you figure out which one to use, you need to understand the difference between jQuery and ExtJs. jQuery includes features like DOM Manipulation, Event Handling, AJAX and allows it to be Extended through plugins. On its own, it includes very little UI components. ExtJs on the other hand is a complete framework, which includes all of the above, and ...


1

To write to a local file from a web page, you would likely need to use silverlight or flex. Browser support for writing to local files using javascript is inconsistent, bleeding edge.



Only top voted, non community-wiki answers of a minimum length are eligible