How to set the info template on a wms layer - arcgis

In arcgisdynamicmapservicelayer I can set a template for the popup window like this:
setInfoTemplatesObject[tooltipObject.Laagindex] = { infoTemplate: new InfoTemplate(tooltipObject.Title, tooltipObject.Content) }
layer.setInfoTemplates(setInfoTemplatesObject);
Is there a way to do this with a WMS layer?
I'm looking for a way to do this in a WMS layer:

The WMS spec does not clearly define what the service has to return from the GetFeatureInfo method, so there API function to do this for WMSLayer. More info in this thread.

Related

Adding a WMS layer to folium

I've been looking at Adding a WMS layer using folium
and https://python-visualization.github.io/folium/modules.html.
I managed to get the example in the above link to work in streamlit but not the WMS I'm trying. I've also tried the WMS in qgis and it works.
I realized I need to specify the coordinate system when connecting to the WMS in the below link. From what I can tell both folium and the wms supports EPSG:900913 = EPSG3857(?). However when adding the wms tile layer all i get is my base map. But the WMS isn't showing.
The WMS can be found at https://resource.sgu.se/dokument/produkter/jordarter-25-100000-wms-beskrivning.pdf
https://resource.sgu.se/service/wms/130/jordarter-25-100-tusen
import streamlit as st
import folium
import streamlit_folium
map_geo = folium.Map(location=[57.8,14.14], zoom_start=13, width=1200)
try:
folium.raster_layers.WmsTileLayer(url ='https://resource.sgu.se/service/wms/130/jordarter-25-100-tusen',
layers = ['jord:SE.GOV.SGU.JORD.TACKNINGSKARTA.25K'],
transparent = False,
control = True,
fmt="image/png",
name = 'SGU',
attr = 'im seeing this',
overlay = True,
show = True,
CRS = 'EPSG:900913',
version = '1.3.0',
).add_to(map_geo)
folium.LayerControl().add_to(map_geo)
except Exception as e:
st.write(e)
streamlit_folium.st_folium(map_geo)
I think it may be due to the fact that the target URL and the layer designation are different. I just don't know if the called layer is the intended layer or not. I got this https://resource.sgu.se/service/wms/130/jordarter-25-100-tusen and layer from the content of the link provided.
import folium
map_geo = folium.Map(location=[57.8,14.14], zoom_start=10, width=1200)
folium.raster_layers.WmsTileLayer(url ='https://maps3.sgu.se/geoserver/jord/ows?',
layers = 'SE.GOV.SGU.JORD.TACKNINGSKARTA.25K',
transparent = False,
control = True,
fmt="image/png",
name = 'SGU',
attr = 'im seeing this',
overlay = True,
show = True,
CRS = 'EPSG:900913',
version = '1.3.0',
).add_to(map_geo)
folium.LayerControl().add_to(map_geo)
map_geo

Turn off layer from LayerList widget on load (ArcGIS JavaScript v3)

I want to turn off layers from the LayerList widget in ArcGIS on load. Is it possible?
There is a layer property called "listMode" that controls if a layer is visible in the LayerList widget. Just set this property to "hide" in the layer constructor.
For example with your layer:
var recreationLayer = new ArcGISDynamicMapServiceLayer("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Recreation/MapServer", {
"id": "recreationLayer",
"showAttribution": false,
listMode: "hide"
});

UWP Page Transition Animations

I programing in Windows 10 UWP.
I have a Frame in Xaml that I would like to have the Page/Content to slide left and off screen when the use navigates away from the page to another page. Any Idea how to do Frame Navigation Animations?
Try to use build-in animation:
protected virtual void SetUpPageAnimation()
{
TransitionCollection collection = new TransitionCollection();
NavigationThemeTransition theme = new NavigationThemeTransition();
var info = new ContinuumNavigationTransitionInfo();
theme.DefaultNavigationTransitionInfo = info;
collection.Add(theme);
this.Transitions = collection;
}
Call this method in Page's constructor and you will find that there will be animation when you enter or leave a Page.
There are few build-in animations which names end with Info, you should try them by yourself.
There's a built-in way to do this, but that only supports a set of not customizable animations / page transitions.
If you want to do custom animations you'll need to implement your own Frame + Page subclasses, where your Pages contain their own entrance/leaving animations and your Frame calls these when navigating.

How to disable event propagation to lower level layers?

I use cocos2d-x 3.0 RC1 and I need the following: the topmost layer should get all the events, and should not propagate the events to the layers that are below the topmost layer. I don't know how I can do that. I have tried to figure out something with setTouchEnabled and setSwallowTouches but null result.
Please help. this is very important.
The only way I have found is to implement this:
auto m_touchListenerOneByOne = EventListenerTouchOneByOne::create();
m_touchListenerOneByOne->setSwallowTouches(true);
m_touchListenerOneByOne->onTouchBegan = CC_CALLBACK_2(IntroView::onBoardTouchBegan, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(m_touchListenerOneByOne, this);
the code above I wrote in init method of the layer. Also this:
bool IntroView::onBoardTouchBegan(Touch* touch, Event* event)
{
CCLOG("AAAAAAAAA!");
return true;
};
When you return true in onBoardTouchBegan you “consume” touch, otherwise if layer don’t consume touches those touches are passed to next Layer by priority.

Using Tiles templates windows8

I'm trying to use tiles templates(a tile which shows an image and switches to show text)
http://msdn.microsoft.com/en-us/library/windows/apps/hh761491.aspx#TileSquarePeekImageAndText04
The question is: where do I put this XML and how can I call it in XAML?
You don't call it in XAML, you provide it to a TileUpdater instance, as you can see from the documentation for TileUpdateManager below. This simplistic scenario handles a local notification (but there are also scheduled, periodic, and push notifications you can leverage).
Take a look at the App tiles and badges and Push and periodic notifications samples for guidance.
function sendTileTextNotification() {
var Notifications = Windows.UI.Notifications;
// Get an XML DOM version of a specific template by using getTemplateContent.
var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.tileWideText03);
// You will need to look at the template documentation to know how many text fields a particular template has.
// Get the text attribute for this template and fill it in.
var tileAttributes = tileXml.getElementsByTagName("text");
tileAttributes[0].appendChild(tileXml.createTextNode("Hello World!"));
// Create the notification from the XML.
var tileNotification = new Notifications.TileNotification(tileXml);
// Send the notification to the calling app's tile.
Notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);
}