How to set google static map font for city town label - api

I need to set small font size of google static map. So, what are the required parameters to achieve the same thing. Since, i am using the below url to get static map
http://maps.googleapis.com/maps/api/staticmap?center={$randAppPhoto['latitude']},{$randAppPhoto['longitude']}&scale=2&size=700x400&maptype=terrain&markers={$randAppPhoto['latitude']},{$randAppPhoto['longitude']}&zoom=7&format=jpg&sensor=false
where, $randAppPhoto is an array in php which has dynamic lat , long

I don't think it's possible to change the font for the texts on the maps. You can check a list of parameters for setting map styles here.

Changing scale=2 to scale=1 in the URL will make the street name font smaller, if that's what you're trying to do.

Related

Is it possible to set a specific font in Mayavi instead of the font family?

Is it possible to set a specific font in Mayavi instead of the font family?
So far I only found the option
cb.title_text_property.font_family = 'times'
But I would like to use something like
cb.title_text_property.font_name = 'Roboto Light'
Is there maybe a way to reach through to vtkTextProperty?
If the symbolic constant VTK_FONT_FILE is returned by GetFontFamily(),
the string returned by GetFontFile() must be an absolute filepath to a
local FreeType compatible font.

How to remove all text color attributes from a QTextDocument?

I've got a QTextDocument read from an HTML file; given a QString of HTML data named topicFileData, I do topicFileTextDocument.setHtml(topicFileData);. I then want to strip off all of the color information, making the whole document just use the default foreground and background brush. (I do not want to explicitly set the text to be black text on a white background; I want to remove the color information from the document.) (Background info: the reason I need to do this is that there are spans within the document that are erroneously set with a black foreground color, rather than just having no color information set, and that causes those spans to display as black-on-black when my app is running in "dark mode", when Qt changes the default text background brush to be black instead of white.)
Here's what I tried:
QTextCursor tc(&topicFileTextDocument);
tc.select(QTextCursor::Document);
QTextCharFormat noColorFormat;
noColorFormat.clearForeground();
noColorFormat.clearBackground();
tc.mergeCharFormat(noColorFormat);
This does not work, unfortunately; it looks like mergeCharFormat() does not understand that I want the clearForeground() and clearBackground() actions to be merged in to strip off those attributes.
I can do tc.setCharFormat(noColorFormat); instead, of course, and that does strip off the color attributes correctly; but it also obliterates all of the other character format info (font, etc.), which is not acceptable.
So, ideally I'd like to find an API that lets me explicitly remove a given text attribute from a QTextDocument. Alternatively, I guess I need to loop through all the spans of the QTextDocument one by one, get the char format of the current span, remove the color attributes from the format, and set the modified format back onto the span. That would be fine; but I have no idea how to loop over spans in that way. Thanks for any help.
Instead of creating a new instance of QTextCharFormat, update the current format and reapply it on the QTextEdit;
default = QTextCharFormat()
charFormat = self.textCursor().charFormat()
charFormat.setBackground(default.background())
charFormat.setForeground(default.foreground())
self.textCursor().mergeCharFormat(charFormat)
A sub-optimal solution that I have found as a workaround is to actually edit the HTML data string before I create the QTextDocument, using a regex:
topicFileData.replace(QRegularExpression("(;? ?color: ?#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f])"), "");
This works for my situation, because all of the colors in my HTML file are set with color: #XXXXXX style attributes that can be stripped out of the HTML itself. This is fragile, however; colors specified in other ways would not be stripped, and if the body text of the HTML document happened to contain text that matched the regex, the regex would modify it and thus corrupt the content of the document. So I don't recommend this solution, and I won't be accepting it. If somebody can offer a better solution that would be preferable.

How to address the DigiScan safe position?

is anybody aware of a way to change the DigiScan safe position using scripting commands?
Cheers
Unfortunately the answer (up to the current version GMS 3.3 at least) is:
This property is only accessible via the UI.
One can read the position, as it is stored in the global tags (see example below), but changing the values in the tags does not set the value in the currently used parameter set.
string strX = "Private:DigiScan:X Beam Park Position"
string strY = "Private:DigiScan:Y Beam Park Position"
number px,py
GetPersistentTaggroup().TagGroupGetTagAsLong(strX,px)
GetPersistentTaggroup().TagGroupGetTagAsLong(strY,py)
result("\n"+px+"/"+py)

Getting Font Size of NSAttributed string

I'm trying to get the font size of an NSAttributedString, however, I'm having trouble doing this.
How do you get the font size of an NSAttributedString in objective-c?
An attributed string does not have "a font size". The used font is an attribute, which can vary over the String. Look at your Q: There are two different fonts in one paragraph. (One for the usual text and one for the keywords.)
Therefore you can only ask for the existing attributes (including font) at a specific location. I. e. - attributesAtIndex:effectiveRange: does this job for you. The attribute key for the font is NSFontAttributeName. If yo do not find this key in the attributes dictionary, it is Helvetica(Neue), 12 pt.

Get latitude and longitube from city name

I would like to enter the city name in the UISearchBar,then the map will jump to the current city.
How to do it?
You would need some kind of NSDictionary which would contain all of the city names with their map references (lat/long) maybe this could be integrated with google maps or some other mapping software. Otherwise you will need to attain or build the dictionary manually. Once you have the map reference you could scroll the map to the right location.