More

Blank map when working with OpenLayers and Geoserver


I'm trying to develop a map with 4 layers: two shapefiles (layers: "roads" and "hospitals") and two World Image Files (layers: "hypsometric","shadows"). I installed OpenLayers and tried to write correct code, but something is wrong, because I get only blank map when I enter address: http://localhost:8080/geoserver/www/wms.html.

This is my code:

 '

I'm working with OpenLayers for the first time.


Your bounds are wrong (or your projection is wrong). Your map is in EPSG:4326 (lat/lng WGS83) so the maximum for a longitude is 180 and the maximum latitude is 90. Your bounds are 564840.1, 5075229.7,588160.6, 5093252.2 - which are clearly not going to work.


I am unable to catch an obvious error by just reading the code. Anyway, there is something that I dislike and that perhaps is a source of errors: you do not explicit set at least one base layer. (I know that in OpenLayers this practice is not mandatory, but I find it very recommendable.) Is the layer 'hypsometric' the base layer? If so, is this layer transparent?


Well i see that layer2, layer 3 and so on are not declared like layer1. You should put the "var" before the names of the layers. See if that solves the problem.

Try using this if you like:

OpenLayers.ProxyHost="/cgi-bin/proxy.cgi?url=";

Or this way:

OpenLayers.ProxyHost="http://localhost:8080/geoserver/www/cgi-bin/proxy.cgi?url=";

Write this inside the init function. The proxy.cgi archive is inside you examples directory in your openlayers folder. Create a folder named cgi-bin inside your web root folder and put the proxy.cgi archive there.


Hfrhyu

Any stored/leased 737s that could substitute for grounded MAXs?

Inverse square law not accurate for non-point masses?

Did pre-Columbian Americans know the spherical shape of the Earth?

Centre cell vertically in tabularx

malloc in main() or malloc in another function: allocating memory for a struct and its members

How to ask rejected full-time candidates to apply to teach individual courses?

Derived column in a data extension

Is there a spell that can create a permanent fire?

Does a random sequence of vectors span a Hilbert space?

An isoperimetric-type inequality inside a cube

Keep at all times, the minus sign above aligned with minus sign below

By what mechanism was the 2017 UK General Election called?

What criticisms of Wittgenstein's philosophy of language have been offered?

Is the Mordenkainen's Sword spell underpowered?

Short story about astronauts fertilizing soil with their own bodies

Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?

Use expression to only keep 1 layer in the legend

Unicorn Meta Zoo #1: Why another podcast?Adding and toggling legend with layer in OpenLayers?Filter MapComposer legend to only show layers visible on the mapProgramatically use Openlayers plugin layer in Print ComposerHow can I programmatically remove a layer from the QGIS composer legend without removing it from the map canvas?Combining two layer symbologies into single legend item using QGIS?Filter legend entry for raster layer QGISQGIS - stop layer from showing up in legend on composerDisplay in legend only features present on a map extentMake legend in QGIS only show features in the view extent?QGIS use layout name in styling expression

When I print my project, that includes different layers, I always end up with all the layers in the legend. What I want when printing is to only show 1 layer, that always has the same name "Werken". The rest of the layers are not necessary to be shown in the legend. What kind of expression would I have to write to become this result?

You can manually remove layers from the legend by selecting the layer name and clicking the red "minus" button. If you want to filter the legend by expression, please explain what your criteria are.

@csk I want to only keep the layer named "Werken" in my legend through an expression. The only problem is that I don't know how to do this :) Could you help?

When I print my project, that includes different layers, I always end up with all the layers in the legend. What I want when printing is to only show 1 layer, that always has the same name "Werken". The rest of the layers are not necessary to be shown in the legend. What kind of expression would I have to write to become this result?

You can manually remove layers from the legend by selecting the layer name and clicking the red "minus" button. If you want to filter the legend by expression, please explain what your criteria are.

@csk I want to only keep the layer named "Werken" in my legend through an expression. The only problem is that I don't know how to do this :) Could you help?

When I print my project, that includes different layers, I always end up with all the layers in the legend. What I want when printing is to only show 1 layer, that always has the same name "Werken". The rest of the layers are not necessary to be shown in the legend. What kind of expression would I have to write to become this result?

When I print my project, that includes different layers, I always end up with all the layers in the legend. What I want when printing is to only show 1 layer, that always has the same name "Werken". The rest of the layers are not necessary to be shown in the legend. What kind of expression would I have to write to become this result?

You can manually remove layers from the legend by selecting the layer name and clicking the red "minus" button. If you want to filter the legend by expression, please explain what your criteria are.

@csk I want to only keep the layer named "Werken" in my legend through an expression. The only problem is that I don't know how to do this :) Could you help?

You can manually remove layers from the legend by selecting the layer name and clicking the red "minus" button. If you want to filter the legend by expression, please explain what your criteria are.

@csk I want to only keep the layer named "Werken" in my legend through an expression. The only problem is that I don't know how to do this :) Could you help?

You can manually remove layers from the legend by selecting the layer name and clicking the red "minus" button. If you want to filter the legend by expression, please explain what your criteria are.

You can manually remove layers from the legend by selecting the layer name and clicking the red "minus" button. If you want to filter the legend by expression, please explain what your criteria are.

@csk I want to only keep the layer named "Werken" in my legend through an expression. The only problem is that I don't know how to do this :) Could you help?

@csk I want to only keep the layer named "Werken" in my legend through an expression. The only problem is that I don't know how to do this :) Could you help?


Hfrhyu

Do I really need to have a message in a novel to appeal to readers?

What produces gravitational waves with "periods between about 100 - 8000 seconds"?

Output Devanagari (Hindi) from raw unicode using luatex

How would a mousetrap for use in space work?

Prove that BD bisects angle ABC

Google .dev domain strangely redirects to https

Do wooden building fires get hotter than 600°C?

Creating an enum from its name not value

How to write capital alpha?

How many time has Arya actually used Needle?

Random body shuffle every night—can we still function?

Do permissive or copyleft licenses have a limited term based on US copyright law?

Putting class ranking in CV, but against dept guidelines

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

Is CEO the "profession" with the most psychopaths?

macOS: Name for app shortcut screen found by pinching with thumb and three fingers

I can't update due to The repository 'http://download.opensuse.org/repositories/home:/strycore/xUbuntu_16.04 ./ Release' is not signed

How often does castling occur in grandmaster games?

What's the easiest way to combine specific columns of two matrices?

A term for a woman complaining about things/begging in a cute/childish way

Girl Hackers - Logic Puzzle

How can I prevent/balance waiting and turtling as a response to cooldown mechanics

What is an "asse" in Elizabethan English?

How did Fremen produce and carry enough thumpers to use Sandworms as de facto Ubers?

How to print ArcGIS tile map using MapFish print

Unicorn Meta Zoo #1: Why another podcast?Problem with GDAL_WMS QGIS connecting to an ArcGIS Server?How do I get ArcGIS tiles to display a single layer when multiple layers are available?Printing possible for openlayers GeoJson WFS with Mapfish printing service and wkhtmltopdf?Publish World topographic map to arcgis serverMapfish Print v3 - Blank mapproblem with setting up proxy - ArcGIS JS APIUsing Mapfish Print v2 yaml file for Mapfish Print v3Allowing all hosts on map in Mapfish Print 2.1.2?Print Mapbox XYZ layer using Mapfish/GeoserverCannot load MapService from ArcGIS Server in Javascript API

I could able to configure a MapFish print in GeoServer and also did some printing map from OSM. I need to print a map which is from ESRI Mapserver. Is there any way to do it?

Please Edit the question to contain the error message as ASCII text. This will make the message legible on all devices and searchable by others.

– AhammadaliPK
Jul 11 '18 at 12:32

I could able to configure a MapFish print in GeoServer and also did some printing map from OSM. I need to print a map which is from ESRI Mapserver. Is there any way to do it?

Please Edit the question to contain the error message as ASCII text. This will make the message legible on all devices and searchable by others.

– AhammadaliPK
Jul 11 '18 at 12:32

I could able to configure a MapFish print in GeoServer and also did some printing map from OSM. I need to print a map which is from ESRI Mapserver. Is there any way to do it?

I could able to configure a MapFish print in GeoServer and also did some printing map from OSM. I need to print a map which is from ESRI Mapserver. Is there any way to do it?

Please Edit the question to contain the error message as ASCII text. This will make the message legible on all devices and searchable by others.

– AhammadaliPK
Jul 11 '18 at 12:32

Please Edit the question to contain the error message as ASCII text. This will make the message legible on all devices and searchable by others.

– AhammadaliPK
Jul 11 '18 at 12:32

Please Edit the question to contain the error message as ASCII text. This will make the message legible on all devices and searchable by others.

Please Edit the question to contain the error message as ASCII text. This will make the message legible on all devices and searchable by others.


2 Answers 2

To reporting issues or feature requests on QGIS issue tracking, you need an OSGeo account. Then just login, go to tab New issue and in Tracker option choose Feature request

Get OSGeo account here: https://www.osgeo.org/cgi-bin/ldap_create_user.py

Also see QGIS documentation for bugs, features and issues

That's it. I knew it was something simple ! I was missing the Osgeo account creation step :) Many thanks.

as a feature request. But, as copied from an excellent blog post

Ask a developer to make the changes for you. This is not terribly
effective – you’re basically asking someone to work for free, and take
time away from their family/job/hobbies/social life to do work for
you. That said, it does sometimes happen, and here’s a few reasons I
can think of why:

  • You’ve build up enough “karma” within the project through other
    contributions. If someone has been heavily involved in the
    non-development side of the project (eg translations, documentation,
    helping users out on mailing lists/stackexchange, organising hackfests
    or user groups, etc) then developers are much more likely to want to
    help them out in turn.


  • You’ve got a fantastic idea which has just never occurred to anyone
    before. By bringing it to the attention of a developer you might
    trigger the “wow, I could really benefit from that too!” impulse which
    is hard-wired into some of us!


it's more likely you will get it done (for you) when you hire a developer to do this.


Mdhntd

How can bays and straits be determined in a procedurally generated map?

Is there a familial term for apples and pears?

Extreme, but not acceptable situation and I can't start the work tomorrow morning

Pronouncing Dictionary.com's W.O.D "vade mecum" in English

What typically incentivizes a professor to change jobs to a lower ranking university?

How long does it take to type this?

How do I create uniquely male characters?

I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine

What is the offset in a seaplane's hull?

Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).

Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?

Circuitry of TV splitters

Could a US political party gain complete control over the government by removing checks & balances?

How old can references or sources in a thesis be?

A Journey Through Space and Time

Are tax years 2016 & 2017 back taxes deductible for tax year 2018?

Chess with symmetric move-square

Can a German sentence have two subjects?

I probably found a bug with the sudo apt install function

Why was the small council so happy for Tyrion to become the Master of Coin?

Should I join office cleaning event for free?

What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?

Update Easy AHP plugin of QGIS 3.6

How to turn off Google map data copyrighted window in Google Street layer (Qgis - Openlayers Plugin)?QGIS EasyPrint alternatives for v2.0.1?How to update a QGIS plugin for new version (2.2)?How to create a python plugin in QGIS 2.4.0?QGIS Wien 2.8. Openlayers plugin doesn't workCan I get value from attribute table when I click on it for using in my plugin?Environment variables for QGIS 3 plugin development on WindowsQGIS 3.00 crashes while QGIS 2.99 worked wellPrinting plugin data on QGIS map canvasEasy AHP returns error because it can not find the SAGA 2.3.2 folder

Easy AHP plugin of QGIS is not updated. It is supported in max 2.99 QGIS version. I want to update this plugin as a part of my project so that I can use it in QGIS version 3.6 ( the latest one ). I need some help regarding this, can you please tell me how to upgrade an existing plugin in QGIS.

have you read github.com/qgis/QGIS/wiki/Plugin-migration-to-QGIS-3

Easy AHP plugin of QGIS is not updated. It is supported in max 2.99 QGIS version. I want to update this plugin as a part of my project so that I can use it in QGIS version 3.6 ( the latest one ). I need some help regarding this, can you please tell me how to upgrade an existing plugin in QGIS.

have you read github.com/qgis/QGIS/wiki/Plugin-migration-to-QGIS-3

Easy AHP plugin of QGIS is not updated. It is supported in max 2.99 QGIS version. I want to update this plugin as a part of my project so that I can use it in QGIS version 3.6 ( the latest one ). I need some help regarding this, can you please tell me how to upgrade an existing plugin in QGIS.

Easy AHP plugin of QGIS is not updated. It is supported in max 2.99 QGIS version. I want to update this plugin as a part of my project so that I can use it in QGIS version 3.6 ( the latest one ). I need some help regarding this, can you please tell me how to upgrade an existing plugin in QGIS.


Watch the video: OpenLayers Add Vector Layer to Web Map (October 2021).