Hot answers tagged

6

For the OpenLayers.Format.GeoJSON feature collection use an OpenLayers.Layer.Vector instance. Examples from the OpenLayers Examples Gallery: http://openlayers.org/dev/examples/geojson.html http://openlayers.org/dev/examples/vector-formats.html http://dev.openlayers.org/docs/files/OpenLayers/Layer/Vector-js.html Use a zoom based strategy for displaying your ...


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

Regarding the comment about two separate labels (one for the "rest of the map" and one for the labels): this is what I thought of as well, and it should be fairly easy to implement: var url = "http://myserver.com/wms"; var background = new OpenLayers.Layer.WMS( "Base Map", url, {layers: 'background'} ); var labels = new OpenLayers.Layer.WMS( ...


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

as i understand from the codes and your explanation, it's come to my mind: in OpenLayers.Popup method, there is a parameter which name is closeBox. this works for: {Boolean} Whether to display a close box inside the popup. if you make it true, the closing button will show in popup, in this case when you click to closing box, it is going to destroy all ...


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 ...


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, ...


2

Adding the OpenLayers.ProxyHost will only proxy requests that OpenLayers itself makes and won't proxy requests from the GeoExt framework. But actually you do not need to use a proxy as you can put the request for the Print Capabilities into your page's header as a script tag like this: <script src="http://path/to/mapfish/print/info.json?var=...


2

Have you tried with apostrophes? For me, this works: Ext.Loader.setConfig({ enabled:true, disableCaching: true, paths: { 'Ext': '/lib/extjs-4.1.1/src' ,'Ext.ux' : '/lib/extjs-4.1.1/examples/ux' // 'Ext' : 'http://cdn.sencha.io/ext-4.1.1-gpl/src' //,'Ext.ux' : 'http://cdn.sencha.io/ext-4.1.1-gpl/examples/ux' ,'GeoExt' : '/lib/GeoExt/src/...


2

It has been long time after question but; You don't need a CSS file for GeoExt2. It is enough to show GeoExt2-loader.js directory in your index.html file. For example my app like this <html> <head> <title>MY APP</title> <link rel="stylesheet" type="text/css" href="ext41/resources/css/ext-all-gray.css"> <...


2

I am pretty sure that GeoExt does not work together with ExtJS 4 yet. You should use ExtJS 3.4.0 like GeoExt does in this MapPanel example. You also need to add the ext-base.js which you can see in the above mentioned example. Update: GeoExt does currently only work with ExtJS 3, but GeoExt is planing a code sprint that targets: developing GeoExt 2.0 ...


2

You need to listen to the featureadded event of the vector layer, and then get the geometry there. Have a look at the following JavaScript code: var map; function init(){ map = new OpenLayers.Map('map'); var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://vmap0.tiles.osgeo.org/wms/vmap0?", {layers: 'basic'}); var ...


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

Since GeoExt is based on OpenLayers + Extjs. So basically what you are trying to do is make your own GeoExt like thing. If you want to use Extjs, because of its better display functions. Using GeoExt will be your best choice. If you do not need Extjs, Openlayers can be used like using javascript. Using or not using Extjs, depends on how comfortable you ...


2

GeoEXT and OpenLayers or any JS library and OpenLayers are not directly connected. You can find many, many examples at OpenLayers relying on pure HTML and OpenLayers. These are usually single use cases, but it should get you going.


2

I think mistake in your store. You not determinete fields but try to get it in your columns. Try this store = new Ext.data.Store({ url: '<your_servlet_url>', reader: new Ext.data.JSONReader({ record: 'kad', //its your json record name fields: [ {name: 'kad_status', type: 'string'}, {name: 'kad_id', type: 'int'}...


2

OpenLayers is not built on ExtJS in the same way ArcGIS Javascript API is built on top of dojo. I would instead compare GeoExt with dojox.geo.openlayers. If your question is which framework is better I can say that dojo documentation has vastly improved thanks to SitePen and that dojo provides the tools to create MVC instead of an actual MVC architecture ...


2

Is your vector layer in the Google Mercator projection (900913)? I believe your vector layer has to be in the same coordinate system as the Google Map tiles.


2

If you want to stay in the standards based world (rather than rolling your own AJAX based protocol) then look at using a WFS to request the points from the server using a filter based on your polygon. See http://dev.openlayers.org/releases/OpenLayers-2.12/examples/wfs-filter.html for an example


2

Point WMS Feature Layer??? You can't analyse WMS layer. OpenLayers sees it as a bunch of png files. If WMS comes from Postgis you can send newly drawn polygon via AJAX to database and make intersection using source data.


2

It can't work because you have : Ext 4.2.0 Openlayers 2.12 GeoExt 1.1 and if you carefully read http://geoext.org/tutorials/quickstart.html#getting-geoext you have Download the latest Ext 3.x from the ExtJS website Furthermore, read http://blog.opengeo.org/tag/extjs4/ to confirm


2

I create new project in github to translate GeoExt 1.1 to Extjs 4 https://github.com/vahid-sohrabloo/GeoExt4


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

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.map; map....


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

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

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 @...


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