I have a webpage that displays a GeoTIFF served via GeoServer as an OpenLayers3 ImageWMS.
What I need is to (via a button) reload the OL3 layer after the underlying GeoTIFF changes.
I searched around, and tried
layer.dispatchChangeEvent();
on the layer in question. But the map/image isn't updated.
I have also tried removing the layer, constructing a new layer and add it back. It didn't work either.
The only thing that works is to reload the whole webpage, in which case the map shows the new image but all states in the page is lost.
My question is
How can I reload the layer without having to reload the whole page?
Thanks
To reload data from the server (i.e. the source), you have to call
layer.getSource().dispatchChangeEvent();
in v3.0.0. Note that current master and the upcoming v3.1.0 version use
layer.getSource().changed();
instead.
Related
I have a anchor tag. For the first time(color deep blue link) when I click it, it redirects me to my dynamic graph which forms a curve, you can see the curve being rendered.
But when for the second time when I click the anchor tag(pale pink color), it redirects me to the same dynamic graph but the graph is already loaded/rendered, you don't see the curve being rendered.
Can I solve this problem, as I always want the link and graph react as if its always rendered for the first time
How to solve this by either using JavaScript or PHP.
Thanks in advance.
Image showing link has already been visited
If you have issue with just colour of the link then you can change the colour in css
a:visited{
color: ' #00008B'
}
For re-rendering the links on map . Try clearing cache because browsers stores cache of the all websites that you have visited. This answer talks about how programmatically empty browser cache.
You could trick the browser by changing the URL everytime by adding a random parameter. You may name it totally different if you like.
printf('Visit my graph', microtime(true));
So the URL looks like different on every call and won't get the cache hit, because it is not the same.
Visit my graph
Visit my graph
I need to create a Chrome extension that will work only for one webpage with specific URL. It will monitor changes to list of items (orders) located on page and if new order appears, it will read some values from order and do something with them. It also may be neccessary to refresh the page from time to time (using timer, maybe).
What architechture will be suitable to accomplish such a task?
Now - to thoughts I have so far. I think now of using only one content script bound to page URL. Will it be enough? Or should I introduce some background script also? Or anything else?
As #wOxxOm said in the comments, creating one content script must be sufficient for reading the values and page refreshing.
My problem is rather simple, but I haven´t found a simple solution for it.
I would like keep one div element from reloading while navigating on other pages. So this one div element would be on the same spot and not to refresh, even when I´m going from page to page on my web pages. I have Soundcloud player in this div, which I want to keep from reloading. The idea is to keep it playing the same song while navigating trough other pages. The point is, everything else should be able to reload, while keeping this one div from not reloading.
How to do this in practise is my question?
The only way to accomplish something like that would be to load the pages via ajax, instead of a full round trip to the server.
If you reload the whole page, then you reload the whole page and you can't keep part of it.
You can either:
Use frames (obsolete) to display two pages at once
Only ever display one page but use XMLHttpRequest to fetch new data from the server, DOM to change the content of the page (leaving that one div alone) and use the History API (pushState and friends) to map the changes you are making with JS to real URLs (which, when requested, cause the server to load a page which is the same as the one you have created with your client side JS modifications).
you might want to look into single-page app frameworks, like Angular, to help you quickly establish that kind of front-end functionality you're looking for
I've made a SVG with javascript for navigation as shown in http://www.carto.net/svg/navigationTools/
My map SVG is made with 2 externals references and one of these references must be refreshed periodically.
(use xlink:href="France.svg#france") and (use xlink:href="routs.svg#routes" id="carout" )
Once I refresh the page, my zoom is back to 1:1. Instead I would like my page to refresh the reference and reload the page with the active zoom selected.
If I understand the problem correctly, it seems like you simply want to refresh the second HREF periodically. The problem is that the browser won't reload it unless the HREF address attribute itself changes. So one solution might be to append the date/time to the end of the address - as described in this stackoverflow answer: Refresh image with a new one at the same url.
in my web page i am using google map script its working at first time of page loading within update panel but its not working when i click any server control like button(partial post back) so how can i fix this issue.
When you update an UpdatePanel, all HTML inside is re-rendered. It's possibly you will need to re-initialise the google map script, but we can't really tell unless you post some code...