XYZ and arcgis Esri in openlayers 6 - esri

Does anybody know what parameters are required to use this source
in openlayers 6 XYZ layer
with projection EPSG:4326
https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
thanks

Thank for the help
this source is simpler ( but different ) than the source from the example and has a better resolution
but this Source doesn't need the tileUrlFunction ( just pass the url )
you need
sphericalMercator true
wrapX true
and
tileSize 256
the same options could be used for
https://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}

Related

Getting FILTER variable into MapServer DATA string

I need a solution to the following or a link to a detailed parameter guide that describes a Mapserver MapFile DATA element so I can try and work out a solution.
I'm trying to pass a dynamic filter to the mapfile but can't work out the syntax to do so.
The context is having a web-application where I have a WMS layer in Openlayers that connects to a Mapserver Mapfile which in turn is reading from a PostGIS raster DB.
The vector layers version of this approach has the following base syntax which is fine and works for vector tables in the DB:
DATA "geom FROM some_table using unique id using srid=4326"
FILTER (id = '%id%')
In effect this generates an SQL statement where the FILTER is created as a where clause in the DATA SQL.
However, in a raster DB example the DATA syntax shown at this link [http://postgis.net/docs/RT_FAQ.html#idm28328] is as follows:
DATA "PG:host=localhost port=5432 dbname='some_db' user='some_user' password='some_password' schema='some_schema' table='some_table' where='id=12' mode='2' "
So I can get things to work with hardcoded where elements, i.e. id=12 but in the previous example I could set the id parameter dynamically in the Openlayers WMS query through the FILTER line.
Does anyone know of the syntax to achieve this in the raster DATA example or is it even possible?
you need to add a "validation" object to your id type.
Add something like:
VALIDATION
'id' '[0-9]+'
END
to your layer object.
You can see that page for more explanations:
https://mapserver.org/mapfile/validation.html

How to add mask for component input text bootsfaces?

I would like to know how to add mask for component input text bootsfaces
Are you perhaps looking for the inputSecret? https://showcase.bootsfaces.net/forms/inputSecret.jsf
Update May, 23 2017: Jasper de Vries provided a pull request to BootsFaces implemting the input mask. So the feature will be part of BootsFaces 1.1.1+ (i.e. 1.1.2 or higher).
Original answer:
We haven't implemented this feature yet (see https://github.com/TheCoder4eu/BootsFaces-OSP/issues/267). But I'm sure you can add it using the input mask of Robin Herbots.
If you want the BootsFaces team to prioritize the feature, please tell us on our bug tracker. Thanks!
Examples of predifined Mask:
<b:inputText value="#{bean.val}" mask="numeric" label="numeric input"/>
<b:inputText value="#{bean.val2}" mask="alphabetical" label="alphabetical input"/>
<b:inputText value="#{bean.val3}" mask="alphanumeric" label="alphanumeric input" />

Chart from google api is not formatted correctly

I am using the older version of Google charts API to generate simple images.
for example: https://chart.googleapis.com/chart?chs=250x100&chd=t:265,148&cht=p3&chl=empty%20-%20%20265%20|%20with%20link%20-148
You can find the docs for api here.
The part of the link responsible for values of the chart is followed by the "t:" argument in the link.
As you see I am passing 2 values: 265 and 148 but the chart is showing them as nearly equal halves of the chart.....
Any idea why is that? Did anyone have a similar problem?
All the best,
Adam
The numbers you have supplied are both over 100, meaning that you effectively are trying to display 413%. You can create the correct graph by working out the percentage for each and using that.
In your example, you should have 64% and 36% as the values: https://chart.googleapis.com/chart?chs=250x100&chd=t:64,36&cht=p3&chl=empty%20-%20%20265%20|%20with%20link%20-148
I worked these out with the following equation:
(value / (total)) * 100

Google maps api,Postgis,Multipolygon

PostGis WKT format of Multipolygon is:
MULTIPOLYGON(
((20.229 39.409,20.2241 39.401,20.220 39.410,20.229 39.409)),
((20.209 39.407,20.223 39.400,20.211 39.402,20.209 39.4076))
)
Google Maps api v3 Polygon is:
var triangleCoords = [
new google.maps.LatLng(25.774252, -80.190262),
new google.maps.LatLng(18.466465, -66.118292),
new google.maps.LatLng(32.321384, -64.75737)
];
The question is:
Can i create a multipolygon in google maps?
PostGIS supports a number of output formats directly:
http://postgis.refractions.net/documentation/manual-1.5/ch08.html
See the ST_As() funcs.
The Google Maps API supports a number of these as well (SVG, KML, etc.). You should try using a format that both speak. Now I'm not sure if Google Maps accepts multipolygons in any of these formats. But you could always use the ST_Simplify() func.
var multipolygon=[
[new google.maps.LatLng(x1,y1),new google.maps.LatLng(x2,y2),new google.maps.LatLng(x3,y3)],
.
.
.
[new google.maps.LatLng(x4,y4),new google.maps.LatLng(x5,y5),new google.maps.LatLng(x6,y6)]
];
This is a little old, but I was just working on the same thing, trying to create MultiPolygons from GeoJSON files in Google Maps, so thought I would share.
Basically, no, you can't. But you can create a workaround.
First create something to manage the individual sub-polygons (object, array, etc). Then populate that object with each portion of the multipolygon. Then you can treat the sub-polygons as a group, via custom methods or iteration through them.
See http://www.alecbennett.com/projects/loadgeojson for a quick demo of "MultiPolygon" highlighting on hover in Google Maps v3. Data is loaded from a GeoJSON file, so would be a similar approach to the WKT version.

How to display two series via Google Chart API?

I can't get the two series of numbers to scale together.
Here is sample code that you can paste into...
http://code.google.com/intl/en/apis/chart/docs/chart_playground.html
cht=lxy
chs=400x300
chd=t:20,30,40|1,4,2|24,34,44|3,7,1
chds=20,40,1,4,24,44,1,7
chxr=0,20,54,2|1,0,7,1
chxt=x,y
chxs=0,ff0000,12,0,lt
1,0000ff,10,1,lt
chco=FF0000,00FF00
chdl=Apples
Oranges
chtt=Some+Values
chts=0000ff,24
Translated:
chd=t:s,e,r,i,e,s,1|s,e,r,i,e,s,2|...ors:series1,series2,...ore:series1,series2,...
chds=<series_1_min>,<series_1_max>,...
chxr=<axis_index>,<start_val>,<end_val>,<step>|...
The three varying parameters in question are:
chd=t:20,30,40|1,4,2|24,34,44|3,7,1
chds=20,40,1,4,24,44,1,7
chxr=0,20,54,2|1,0,7,1
Can anyone get this simple example working?
The chart supports multiple series but for some reason I can't scale it so that the values are displayed within scale.
Any help appreciated,
Chris
After some practice I think I needed to make the chds values the same for both sets of data. I need to play with it more but I thought I would post a working example for posterity.
cht=lxy
chs=400x300
chd=t:20,30,40|1,4,2|24,34,44,48|3,7,1,2
chds=10,50,0,10,10,50,0,10
chxr=0,10,50|1,0,10,1
chxt=x,y
chxs=0,ff0000,12,0,lt
1,0000ff,10,1,lt
chco=FF0000,00FF00
chdl=Apples
Oranges
chtt=Some+Values
chts=0000ff,24
chm=o,0000FF,0,-1,5,0|o,ff0000,1,-1,5,0
chg=10,10
Scaling can be tricky to get right.
Try using chds='a' for automatic scaling at first.