Hot answers tagged

5

Change the order of your js-files. Load OpenLayers before the files within js-folder. <script src="ol-211/OpenLayers.js"></script> <script src="ol-211/firebug.js"></script> <script type="text/javascript" src="js/geocoding.js"></script> <script type="text/javascript" src="js/map1.js"></script> <script type="...


4

You can either define vector_term as global variable or pass it as argument in loadKMLTMINT function. To pass as parameter the function definition should be function loadKMLTMINT(terminalcode,vector_term) {


4

You might find the GeoExt3 project interesting, especially the GeoExt.component.Map (API docs) In case you use an older version of OpenLayers (your original question makes me think you actually use v2.x), you can e.g. use GeoExt2.1


3

This should work: assigning new Stylemap and redraw: var cp = new Ext.ColorPalette({value:'993300', "renderTo" : cpid}); cp.on('select', function (palette, selColor) { var newStyle = new OpenLayers.Style({ "fillColor": "#" + selColor, "strokeColor": "#" + selColor, "fillOpacity": 0.4, ...


3

If you want to use OpenLayers 3 with Ext JS 6 you should have a look at https://github.com/KaiVolland/geoext3. It will be merged into https://github.com/geoext/geoext3 in about two weeks. Even if you don't want to use GeoExt 3 itself, you could use some code of the GeoExt.panel.Map and GeoExt.panel.MapController. The most interesting part might be the ...


2

Check Out Cesium which is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. visit http://cesium.agi.com/index.html to download and try may be it will help.


2

You can listen to the Layer's loadend event like this: layer.events.register("loadend", layer, function (e) { //<<---Do your process here });


2

As stated here: The limit is about 75. After that, layers can appear above popups. This has to do with the z-index in CSS (determines what is 'above' what). Layers (overlay) start at a z-index of 325. Popups start at 750. Controls start at 1000. Every layer 'takes up' about 5 indexes, so it will reach it's limit at around 75 layers. You cannot have more ...


2

I made applications with OpenLayers and ExtJS 4. GeoExt was limited to ExtJS 3 when I began. But it will always lag behind the latest developments. Another reason was that I was not so free with the design of the GUI elements, GeoExt has good easy to use solutions but limits the creativity. It depends on your purpose. If you want to tailor your webmap to the ...


2

Just look at how this is done in GeoExplorer: https://github.com/boundlessgeo/suite/tree/master/geoexplorer/app/static/script/ux 1) Add the Ext JS user extension to scripts/ux 2) Add it your buildjs.cfg file: https://github.com/boundlessgeo/suite/blob/master/geoexplorer/buildjs.cfg It should then get included in the build of your application if you add a @...


2

in Ext 4.2 I am using Container inside of Panel: added in initComponent: th.items = [ Ext.create('Ext.Component', { initComponent: function () { var me = this; th.mapContainerId = me.id; me.on("boxready", function () { th.initMap(); }); ...


2

Your for loop will not be entered, because you are trying to get the length of mapPanel.map, which will be undefined. Try to get the length of mapPanel.map.layers instead: listeners: { 'select': function(combo, record) { for(var i = 0; i < mapPanel.map.layers.length; i++) { var myLayer = mapPanel.map.layers[i].name; if (myLayer == this....


2

Due to the asynchronous nature of JavaScript you can't "delay" code execution to wait for a certain event to happen, you need to use completion callbacks. OpenLayers.Map has a range of events you can listen to, the one you need is zoomend: zoomend triggered after a zoom completes Here's a simple example based on your code: var map = MapPanel....


2

You don't have that (yet) on GeoExt 3. Meanwhile, you might check another smaller project focused on managing layers, called extjs_ol3_layercontrol. It is also written in ExtJS. Check the blog and the github. If you add the Geoserver capabilities URL (something like http://localhost:8080/geoserver/wms?service=wms&version=1.3&request=GetCapabilities)...


2

You can load the Shapefile into QGIS, then export a webmap (Openlayers or Leaflet) using the qgis2web plugin. It also allows you to upload directly to the web via FTP.


1

I got it: if(nameAlgorithm == "Center"){ var myStyles = new OpenLayers.StyleMap({ "default": new OpenLayers.Style({ fillColor: "blue", pointRadius: 7, fillOpacity: 0.3, strokeColor:"#F2F2F2" }) }); var vector_layer = new ...


1

Create an Ext.toolbar.TextItem and create your OpenLayers MousePosition-Control in the render-Event of the TextItem, so you can pass the TextItems's Div to the Control. Like this: Ext.create('Ext.toolbar.TextItem', { listeners: { render: function(textitem) { var ctrl = new OpenLayers.Control.MousePosition(); ctrl.div = ...


1

The thing is that the legend of a wms service is actually an image. Having said that how can you display an image inside the tree? what I usually do is either use the Legend Panel, which i can understand is neither handy or neat or use an event to manually get the legend of the layer and display it somewhere more handy. for example: tree.on('...


1

In Openlayers there is loadend event to listen to layer(s) and not map when it is loaded, check below code & link: var mylayer = ''//Openlayers layer object mylayer.events.register("loadend", mylayer, function() { console.log('layer loaded'); }); link: http://dev.openlayers.org/examples/layerLoadMonitoring.html


1

It's working for me with a textfield (id: 'TextField') in the tbar and with the code: var test= Ext.getCmp('TextField'); test.setRawValue();


1

I guess you are using GeoExt as you are talking about a "LayerTree", right? If yes, just use a OverLay-Layer-Container: http://geoext.org/lib/GeoExt/widgets/tree/OverlayLayerContainer.html var layerList = [ { nodeType: "gx_overlaylayercontainer", text: "Overlay Layers", expanded: true }]; var tree = new Ext.tree.TreePanel({ title: "Layer", loader: new Ext....


1

With OL3, it is quite easy to read GeoJSON, using ol.source.Vector. I'm using Ext.direct, but it is the same pattern if you use the regular Ext.Ajax.request call. On the callback, you use the readFeatures method. To read a GeoJSON layer: var vectorSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), loader: function (extent,...


1

You can define the icon class for your button.Just use iconCls: 'your_css_class' and add a css rule with this name .your_css_class { background-image: url(youricon.png) } Example: Button: { text : 'Navigate', iconCls: 'nav', handler: function() { do this and that... } } CSS ...


1

No, GeoExt 2.0.2 (https://github.com/geoext/geoext2/releases/tag/v2.0.2, released two days ago) isn't compatible with ExtJS 5. There is ongoing work towards a version of GeoExt2 which does suppport ExtJS 5: https://github.com/geoext/geoext2/pull/274 You may be able to use the intermediate code in that branch to see if it helps with the popup, but again, it ...


1

There are several options I can think of, but there are probably more and better ways to do it. Depending on how many styles you need, you could create a new rule for each style you need. Set a filter on each type of style like this: <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>POI_TYPE</ogc:PropertyName> <...


1

Because Geoext2 they remove override-ext-ajax.js, but you can mortify urls like this printCapabilities.createURL="./ProxyHost.ashx?url="+printCapabilities.createURL; printCapabilities.printURL="./FTProxyHost.ashx?url="+printCapabilities.printURL; printCapabilities is from http://localhost:8080/geoserver/pdf/info.json?var=printCapabilities. It works fine ...


1

As a fix, here is what I did. Combined the map definition and tree definition in a single file and required some GeoExt classes explicitly in Application.js Ext.define('OPS.Application', { name: 'OPS', extend: 'Ext.app.Application', requires: [ 'OPS.Global', 'GeoExt.tree.LayerContainer', 'GeoExt.tree....


1

You might store your data in the LocalStorage. It allows you have the data stored in the browser. You'll need a data model which you fill with data from XML and store in the browser. The next time you just check if the data is stored and download it if not. The Ext Grid will work with these data well. Have you considered paging the data in grid (you ...


1

What about replacing testlayer.events.register(testlayer, function () { map.zoomToExtent(testlayer.getDataExtent()) }); with testlayer.events.register('loadend', testlayer, function (evt) { map.zoomToExtent(testlayer.getDataExtent()) });


1

To create subnodes set leaf to false: { text: "Root, group: true, children: [{ text: Buildings, leaf: false, expanded: true, children: [{ text: "Buildings Layer 1", layer: "MyTest:BuildingsSHP", ...


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