Right now I am developing webGIS by using Geoserver and I am using Get Feature Info. For the Get Feature Info, I want to show in the pop up the image of the feature (photo image from field) but not all the features already have the photos so I need to check if the photo is exist or not by link. How am I supposed to do that by using FTL? Here is some of my code by using FTL.
<#assign image = "http://10.1.160.59:8082/geoserver/www/project/images/photo/img_"+feature["site"].value+"_"+feature["drillholes"].value+".jpg">
<#if image?has_content>
<tr><td>${"image"}</td> <td><img src=${"http://10.1.160.59:8082/geoserver/www/project/images/photo/img_"}${feature["site"].value}${"_"}${feature["drillholes"].value}${".jpg"} height="200" width="250" style="border-width:1;border-style:solid"/> </td></tr>
</#if>
<#if !image?has_content>
<tr><td>${"image"}</td> <td><img src=${"http://10.1.160.59:8082/geoserver/www/project/images/photo/No_Image.jpg"} height="200" width="250" style="border-width:1;border-style:solid"/> </td></tr>
</#if>
So basically I am supposed to check if the image exists or not. If exists I will use the image link but if not I will use the No Image link.
Related
My image won’t display for no reason. I am a noob but I can’t figure it out. The image loads from the url so I know it’s not that. So I’m pretty sure it’s my problem with the coding.
<body>
<img src=https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?dl=0
Height=300Width=250>
</body>
Your URL is pointing to non-image resource. It's actually pointing to an HTML document.
In URL, change www by dl and remove ?dl=0.
This is valid image URL :
https://dl.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG
Alternatively, you can replace dl=0 to raw=1. This is also valid image URL:
https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?raw=1
Not always required but as a good practice I'll suggest using quotes for values. Also as mentioned in comments seperate attributes from each other with white space.
<img src="https://dl.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG"
height="300" width="250"/>
<!--OR-->
<img src="https://www.dropbox.com/s/rm27v6s4nj885qu/IMG_0071.PNG?raw=1" height="300" width"250"/>
source : Mickel's Tutorial
I hope, you must use the url of image, But you are referring the url preview pane of dropbox.
It is the actual url for image.
You also need some improvisation with your code, as below
<body>
<img src="https://uc215f04ebb05efbc98d874fefb2.previews.dropboxusercontent.com/p/thumb/AA767gGwgVfZ9rVS7PJbtIOR3eQsWN4mrXjNjVJH3JKjhI5eE7JOd-eQJwydUx1gPkpE3zkAnMSN3-1KEtFN86x-CdWnREg0mQ6hm7APBCuifux1ECDivRuLkrikn1sY_r20EmBWucKHyy-Ps5VPB8ehkUB6x0y9kSb3QzYpP8fOo7IeyR6IaCYZ66mxrJiUiUtzTAV3ddESpRV7lSRaumsSyVPc4k1RbUBS3-_JDnP8Qv6M42x2g7bZDy9vdhhIOZaO585_XQHegapCJ-8bnwLGt-VEy9nud0avi_gzMSpXxx3EXt_NYTWMfFqfstb2HFMVb7WK7jxkSRSX5eE5ck3Q0bdEPAKp1aPnClU2KqI-OgUea6ApGp4G0H4Q3l3UyOjfomtn-SndAAaUzPbaU1HK/p.png?fv_content=true&size_mode=5" height="300" width="250" />
</body>
It will work without any issue. You are not referring proper url that the actual issue.
Also, keep tag properties in quote "" if required.
Like
<img src="url" height="200" width="300" />
Thanks.
I am practicing to use excel vba to download information from website: http://mops.twse.com.tw/mops/web/t05sr01_1
But I have no idea how to download the data behind click button, as the image shown: http://i.stack.imgur.com/KZHiZ.jpg
I excerpt its web code as below. Could anyone explain me how to code in excel vba to get its data?
Thank you very mush.
Web code:
<td style='text-align:left !important;' nowrap>鴻海</td>
<td style='text-align:left !important;'>105/01/05</td>
<td style='text-align:left !important;'>11:41:00</td>
<td style='text-align:left !important;'>說明媒體報導</td>
<td><input type='button' value='詳細資料' onclick="document.fm_t05sr01_1.SEQ_NO.value='1';document.fm_t05sr01_1.SPOKE_TIME.value='114100';document.fm_t05sr01_1.SPOKE_DATE.value='20160105';document.fm_t05sr01_1.COMPANY_NAME.value='?E??';document.fm_t05sr01_1.COMPANY_ID.value='2317';document.fm_t05sr01_1.skey.value='2317201601051';document.fm_t05sr01_1.hhc_co_name.value='?E??';ajax1(this.form,'table01');">
You haven't shown how you are getting the html.
You can use a CSS selector.
General for first input button
input[type=button]
This says element(s) with input tag having attribute type whole value is 'button'
You apply with the querySelector method, or querySelectorAll if more than one match and then use index for required element.
ie.document.querySelector("input[type=button]").Click
If in an HTMLDocument variable e.g. htmlDoc then
htmlDoc.querySelector("input[type=button]").Click
I'm working in a responsive newsletter and I'm nearly finished. In the last two weeks I read about the issues and things to mess when coding a responsive newsletter.
My newsletter is ready to use and responsive but now I face some problem that I cant solve since two days.
I got an image that is responsive in Outlook:
<img src="#" style="width:230px;max-width:96%;border:0px;" width="230">
and a table that is also responsive in Outlook:
<table width="800" style="width:800px;max-width:96%;text-align:justify;font-family:arial;color:black;font-size:14px;line-height:1.2em;">
<tr>
<td style="text-align:justify;font-family:arial;color:black;font-size:14px;line-height:1.2em;">
MASS-TEXT
</td>
</tr>
</table>
so far so good - it works great. BUT if I put the image in the table it isn't responsive anymore:
<table width="800" style="width:800px;max-width:96%;text-align:justify;font-family:arial;color:black;font-size:14px;line-height:1.2em;">
<tr>
<td style="text-align:justify;font-family:arial;color:black;font-size:14px;line-height:1.2em;">
<img src="#" style="width:230px;max-width:96%;border:0px;" width="230">
</td>
</tr>
Anybody know a solution for this or know why it isn't working because it works as single elements?
I tried a few things like give the rows and columns a percentage width and so on... nothing working. I just want a responsive table with a responsive image inside working for outlook... someone experience with this?
Dont you think that the max-width should be static and width should be relative i.e. max-width:800px and width:96%;
The below code works well in the standard outlook version. Outlook responsive Image in table working.
<table width="600" >
<tr><td>
<img src="add image link"/>
</tr></td>
</table>
I am a newbee to selenium webdriver by using python
Below is the configuration:
Selenium WebDriver: selenium-2.40.0(Python bindings)
Python Version : Python 2.7
OS : Windows
I have tried hitting the mentioned control through the xpath and the css selector in my script but was unable to hit that control.I also crosschecked it in the xpath viewer with the xpath, it was showing it there .I also tried to hit the control with the css selector but it was not hitting it.I am able to access other controls that are there on the webpage using css selector and xpath.I have also attached the HTML code with the xpath and css selector syntax i am using in my code.
The Xpath I am using for the script is : find_element_by_xpath("//img[#title='Expand All' and #alt='Expand All']")
The css selector i am using in my script is : find_element_by_css_selector("a[class='lnk1'][onClick*='treeTable(expandAll)']")
<table width="" cellspacing="0" cellpadding="0" border="0" role="presentation">
<tbody>
<tr>
<td width="">
<a class="lnk1" onfocus="" onclick="this.style.cursor='wait';document.body.style.cursor='wait'; return doTblAjax('WTableForm_453ea28b', 'action_453ea28b', 'treeTable(expandAll)', 'tableTop_453ea28b', 'action_453ea28b', 'wh', 'wa', event);" onblur="" href="/hmc/bonsai/action/T56?wh=action_453ea28b&action_453ea28b=treeTable%28expandAll%29×tamp=144e404faf0#tableTop_453ea28b">
<img class="tbl9" width="32" border="0" align="top" height="32" title="Expand All" src="/wclres/wcl/images/tretbl1.gif" role="button" onmouseover="className='tbl10'" onmouseout="className='tbl9'" alt="Expand All">
</a>
Try with this CSS Selector
The Safe Method css=div.someClass'] a[contains(#onclick,'treeTable(expandAll)')] > img
This will be serving as unique xpath for Expand Button.
Thanks!
I'm triying to insert a image on the pdf generated by the script.
I have put a image that is on the folder and it shows correctly, but the generated one no.
In other section of the site, I use the same function to generate and show the image and it shows correctly, only when I put on the pdf gets a blank gap.
$html1 = '
<p align="left" style="color:#434343;">
<span align="justify" style="color:#fe5a1d; font-size:35px;">3.3.- Comparativa Evaluación Tu Total – Evaluación media Total</span>
</p>
<p align="justify" style="color:#434343; font-size:34px;">
<img src="'.DOMINIO.'intranet/graph.php?ide='.$evaluacion->getId().'&tipo=3" border="0" width="700" height="230"/>
</p>
<p align="left" style="color:#434343;">
<span style="color:#fe5a1d; font-weight:bold;">4.- Detalle por competencias</span>
</p>
<p align="justify" style="color:#434343; font-size:34px;">
<img src="'.DOMINIO.'intranet/graph.php?ide='.$evaluacion->getId().'&tipo=4" border="0" width="700" height="230"/><br />
</p>
This is the code that makes a little paragraph that is shown on the PDF, the text works nice, it's only the image not shown.
Thanks for all.
Its most likely a problem with your PHP setup, specifically make sure you have support for GD image installed and enabled.
Now its solved, what i've done is render the images on the HardDisk and load it on the pdf