Hide poi.business markers/labels in Google Static Maps API - api

I'm building a static Google Map URL to be used within <noscript><noscript> tag on a 'Find Us' page as fall-back in case a user has scripting turned off. Code thus far is:
<div id="map" class="map">
<noscript>
<img src="https://maps.googleapis.com/maps/api/staticmap?center=[lat],[long]
&zoom=17
&size=600x400
&scale=1
&maptype=hybrid
&visible=[lat],[long]
&key=[key hidden]">
</noscript>
</div>
However, on the resulting map image, there are markers for other businesses (e.g. orange knife & fork markers for restaurants) and/or points of interest.
I want to suppress the display of these markers, and add a custom marker for my location of interest (&markers=.... not shown in the code snippet above).
I cannot find anything in the Static Maps API documentation, nor on stackoverflow.
Is there a way to achieve this, or am I stuck with them on a Static Map?

Tack this on your query string:
style=feature:poi|visibility:off
You can find other stylings here.

Related

Using Selenium with Java on Salesforce Lightning / Javascript problems

We had Selenium tests running on Sales Force non Lightning. Now I am converting to Lightning. There is a chain of menus to go through. I have successfully navigated to a certain menu, but now I have run into a problem. This is not the standard question about new element names. Here is the question. This is a small piece of what the page looks like (see below).
When using inspect with Chrome I can find the elements. This is what it looks like (a small cross section corresponding to above). The SPAN tag has the label ("Original Agreement") and the DIV below it will contain the box for the input value.
<div class="slds-form-element__control" data-aura-rendered-by="228:1224;a">
<div data-aura-rendered-by="1108:0" class="uiInput forceSearchInputLookupDesktop uiInput--default" data-aura-class="uiInput forceSearchInputLookupDesktop uiInput--default">
<label class="label inputLabel uiLabel-left form-element__label uiLabel" for="157:1224;a" data-aura-rendered-by="1103:0" data-aura-class="uiLabel">
<span class="" data-aura-rendered-by="1104:0">Original Agreement</span>
<!--render facet: 1106:0--><!--render facet: 1107:0--></label>
<div data-aura-rendered-by="161:1224;a"><div class="contentWrapper slds-box--border" data-aura-rendered-by="162:1224;a">
However, Selenium can not find the elements (though inspect does). When I did a "View Page Source instead of an
inspect, almost the entire thing is in JavaScript like this:
function rewriteAndInjectCss(linkEl, source, varLookup) {
var css = rewriteCssVars(source, varLookup);
injectStyles(linkEl, css);
}
but a lot more. Almost all functions, with maybe only a couple elements.
In the past when I have seen something similar there is often an iframe to switch to to get the elements. But there is no iframe to switch to. So I am stuck how to get these. Can anyone shed some light?
OK. Found it. I needed to do a driver.switchTo().defaultContent()

Mustache variable for language preference in deepviews?

My company is running an email campaign for app downloads using branch.io. As users may open a given link on a desktop OR on their phone we need to support both cases.
We've implemented a branch "Deepview" because we love the ease of the text-to-download feature. The problem is, there doesn't seem any way to provide a localized version of this view, and we support many different languages.
Because I can't run scripts in the custom deep view (branch.io strips them out, I assume for security reasons), and because I don't have access to a language mustache variable, I can't change content by locale.
Is there any way to localize deepviews based on a URL param or (ideally) based on window.navigator.language(s)? If I just had a mustache variable exposed for language_code of the user, everything could work.
Here was my attempt at hacking it in:
.lang-en .phone-number-label:after {
content: "Phone Number";
}
.lang-en .btn-submit-label:after {
content: "Send Me The App";
}
<div class="container lang-en">
<h3 class="phone-number-label"></h3>
<input name="phone" id="phone" placeholder="+1 (123) 123-1234" type="text" class="phone-input"></input>
<button id="phone-submit" type="submit" class="phone-submit">
<span class="btn-submit-label"></span>
</button>
</div>
The 'lang-en' is intended to be generated as follows:
<div class="container lang-{{language_code}}>...</div>
I briefly got this to work by highjacking $og_description from the url:
https://bnc.lt/my-branch-link?$og_description<language_code_provided_as_query_param>
but after awhile, the {{link_data.$og_description}} stopped coming through at all into the mustache template (when passed as a url param). This also is probably not great practice. Let me know if anyone has a solution here, or if branch.io devs are willing to expose this variable in their mustache template data.
I have good news! Branch Deepviews use Handlebars, utilizing this will allow you to set the "Get the App" -- "See this content immediately after install" and other variables with your deep linked values. Let me show you some code and a screenshot from an example that I just built for you.
Code example:
{{#if link_data.cta_text_localized}}{{link_data.cta_text_localized}}{{else}}Get The App{{/if}}
The Handlebars come into play for the "Get the app" Button here:
{{#if link_data.cta_text_localized}}{{link_data.cta_text_localized}}{{else}}Get The App{{/if}}
To spell it out, if the deep link value "cta_text_localized" exists within this link, then use that String for the "Get the App" button, otherwise use "Get the App." You can configure deep link data from the marketing section of your Dashboard, at the bottom of an "add link" dialog, attached screenshot:
Screenshot of my ES customized Deepview, note the altered "Get the App" button:
As you can see, using a liquid tag that grabs text from my deep link value "cta_text_localized" I set the "Get the App" button to a custom String. Using this method you would create a link for every language that you wanted to display, setting your deep link values accordingly, while your template always pulled from the same variable.

Change Global Variable onclick/img source update with javascript variable

First off I am completely new to Javascript but I have some HTML/CSS experience. I've been trying to create an html/javascript image gallery for a website; (It would probably be a lot easier to do in PHP but the web coordinator disabled PHP on our server for security reasons).
Anyway What I have is a page showing an Album-list, Album-browser and Photo-viewer in different a div and 2 iframes respectively. I have it set up so that when someone clicks on an album from the album list, a page is opened up in the album browser section (iframe:"browser-frame" showing thumbnails of all the images in the particular album). I've been trying to set it up so that when someone clicks on an image in the album browser the image will appear in the Photo-viewer section (iframe:"viewer-frame" showing the photo itself).
I didn't want the photo's in the viewer-frame to be larger than the set dimensions for the viewer-frame so I created a page for the viewer-frame that puts the image in a div with a class of set dimensions (defined in a stylesheet) as follows:
...<body>
<div class="photoview">
<img id="viewed_image" class="large" src="images/album1/1.jpg" />
</div>
</body>...
I then created a script that updates the image src to a variable:image_to_be_viewed and called it image-changer.js
// JavaScript Document
{
var image_to_be_viewed="images/album1/1.jpg";
document.getElementById("viewed_image").src=image_to_be_viewed;
}
And added a script to the viewer-frame page so it looks like:
...<body>
<div class="photoview">
<img id="viewed_image" class="large" src="images/album1/1.jpg" />
<script src="image-changer.js"></script>
</div>
</body>...
Now I wanted the gallery to work so that in the page loaded in the browser-frame, whenever one clicked on one of the pictures, the value of the global variable 'image_to_be_viewed' would be changed to the source of the clicked image as follows:
<body>
<div class="photobrowse">
<img class="medium" src="images/album1/1.jpg" onClick="image_to_be_viewed='images/album1/1.jpg'"/>
<img class="medium" src="images/album1/2.jpg" onClick="image_to_be_viewed='images/album1/2.jpg'"/>
<img class="medium" src="images/album1/3.jpg" onClick="image_to_be_viewed='images/album1/3.jpg'"/>
</div>
</body>
It doesn't work....
the gallery i'm working on is on http://ptc.tamu.edu/test/gallery_directory/test_gallery.html
everything up to the loading of the selected picture in the viewer frame works (I'm running the onlick event on the default loaded pictures 1,2,3 in the browser-frame page)(default pic's 4 and 5 simply load the image in the iframe but with no way to adjust the size it is too big and gets cut off and i don't want that)
I've been working on for an entire day and I'm sure I'm doing something wrong here but I can't figure out what exactly it is. I have a feeling it has to do with changing the global variable: image_to_be_viewed from the browser-frame page but I wanted to confirm with experts instead of flopping about like a headless fish. I'm going to continue trying to figure this out but i thought maybe having some expert assistance would speed up the process.
What the onclick triggers should be a javascript function call.
e.g. onclick="changeImg('images/album1/1.jpg')"
And the function itself should looks like this
function changeImg (image_to_be_viewed) {
document.getElementById("viewed_image").src = image_to_be_viewed;
}
btw, you probably should learn javascript a little bit more before work on something real. I recommend this book
thank you I got it to work! I figured that the changeImg function was targeting the wrong document/wrong frame and I fixed it by changing the js script to:
function changeImg (image_to_be_viewed) {
window.parent.viewer_frame.document.getElementById("viewed_image").src = image_to_be_viewed;
}

RDFa Snippet Generator from GoodRelations

I've created a RDFa snippet to use on a client's website using the GoodRelations tool. The generated code creates the tags as expected, but there's no text between the divs, for instance:
<div typeof="vcard:Address">
<div property="vcard:locality" content="Yorba Linda"></div>
</div>
I'm assuming that this is OK, and that I am expected to put descriptive text for humans between the 'locality' divs without any adverse effects (in relation to SEO.) Correct?
As William says: In most cases, is is impractical to reuse visible content for publishing meta-data, because they differ in sequence or structure. In that case, it is better to put all meta-data in a single block of <div> elements without visible content. This is called "RDFa in Snippet Style", see
http://www.ebusiness-unibw.org/tools/rdf2rdfa/
Hepp, Martin; GarcĂ­a, Roberto; Radinger, Andreas: RDF2RDFa: Turning RDF into Snippets for Copy-and-Paste, Technical Report TR-2009-01, 2009., PDF at http://www.heppnetz.de/files/RDF2RDFa-TR.pdf
Google is consuming such markup, despite a general preference for marking up visible content. Many big shops are using this approach with good results, e.g. http://www.rachaelraystore.com/Product/detail/Rachael-Ray-Stoneware-2-pc-Bubble-Brown-Baker-Set-Eggplant/316398
So if you can integrate the visible content and the RDFa constructs, then use
<div typeof="vcard:Address">
<div property="vcard:locality">Yorba Linda</div>
</div>
If you cannot, then use
<div typeof="vcard:Address">
<div property="vcard:locality" content="Yorba Linda"></div>
</div>
...
<div>
<div>Yorba Linda</div>
</div>
But the divs with invisible content must be close to the visible content and be placed better before than after the visible markup.
From and RDFa point of view, it is fine (I am assuming you are using bracers because you don't know how to escape greater than / less than characters).
The only thing you need to think about is how adding this fragment of HTML to your HTML document, will affect the rendering. Based on the fact that you are using the content attribute, this fragment is destined to remain hidden. So yo should think about this in relation to the CSS architecture. My advice would be to create a specific CSS class that is for annotations.
Having spoken to the author of Good Relations, his advice would be to put this fragment before any other HTML element in the body of your document. Generally, the Rich Snippets team indicate that they ignore hidden RDFa, but it doesn't actually matter and really in the long run it enables the publishing of RDF to anyone (not only Google) who wants to consume it.

How to create a Web slice with Search?

Does anyone know how bing's weather webslice search works? I am attempting to create a web slice(only available in IE8) with search built in and I have read that forms are not allowed and neither is javascript. Any help would be appreciated.
You can create active content by defining it on another page using the entry-content rel attribute of an tag. In this example slice.aspx has JavaScript code on it.
<div class="hslice" id="MySlice">
<p class="entry-title">
My Active Slice</p>
<a rel="entry-content" href="slice.aspx" />
<div class="entry-content">
</div>
</div>
You can achieve a similar effect using some simple javascript in a Chrome extension to create an Arbitrary Web Slice extension but with the advantage of being able to take any slice out of any web page, not just predefined Web Slice areas like Bing weather. Obviously only works in Chrome but Firefox has a similar extension API in GreaseMonkey.