Custom images not working in new gmaps4rails v2 - ruby-on-rails-4

Migrate gmaps4rails v1 to v2 (great gem!). But i cannot get the custom marker images only the default one.
output code:
handler.buildMap({ provider: {}, internal: {id: 'map'}}, function(){
markers = handler.addMarkers([{"lat":43.3851,"lng":12.3856,"picture":{"picture":"/assets/house.png","width":"32","height":"32"},"title":"blablabla"}
controller
#locations = Location.where(:region => #region.id)
#hash = Gmaps4rails.build_markers(#locations) do |location, marker|
marker.lat location.latitude
marker.lng location.longitude
marker.infowindow location.description
marker.picture({
"picture" => "/assets/house.png",
"width" => "32",
"height" => "32"
})
marker.json({:title => location.description})
end
If you look ate the output the code works...but i don't see the custom marker house.png.
Am i doing something wrong here? Security issue?
Thanks..remco

You're simply not following the doc/examples, use:
marker.picture({
"url" => "/assets/house.png",
"width" => "32",
"height" => "32"
})

Related

Conversion from realurl to routeEnhancers in TYPO3 9... Adapt LookUpTables with additional ValueMaps or how to define the "zero-value-segment"?

I am upgrading a project about training courses and my URL-segments are like:
/category/course/location.html
Got it running with the following configuration:
routeEnhancers:
PageTypeSuffix:
type: PageType
default: '.html'
map:
'.html': 0
CoursePlugin:
type: Extbase
limitToPages:
- 1
- 15
- 17
- 18
extension: Course
plugin: Catlist
namespace: course_catlist
routes:
- routePath: '/{category_title}/{course_title}/{location_title}'
_controller: 'Category::list'
_arguments: {category_title: 'category', course_title: 'course', location_title: 'location'}
defaultController: 'Category::list'
aspects:
category_title:
type: PersistedAliasMapper
tableName: tx_course_domain_model_category
routeFieldName: 'slug'
course_title:
type: PersistedAliasMapper
tableName: tx_course_domain_model_course
routeFieldName: 'slug'
location_title:
type: StaticValueMapper
map:
alle-standorte: 0
hamburg: 1
berlin: 2
The problem is now: It's only working if there are values for all 3 parameters set! But for example there could be a segment like
/language-courses/all-courses/berlin.html
The course-parameter is empty, so all "language-courses" in "berlin" are shown in a list.
In realurl it is possible to combine a lookUpTable with a valueMap!
array(
'GETvar' => 'tx_course_catlist[course]',
'valueMap' => array(
'all-courses' => "",
),
'lookUpTable' => array(
'table' => 'tx_course_domain_model_course',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND deleted=0 ',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
),
)
How can I adapt this in TYPO3 9? Any experience or ideas? How can I map an empty-value for a segment of a PersistedAliasMapper?
Found a solution:
Create a record with an uid=0 in the database. Call the path-segment-field for example like "all-courses".
This has an unpleasant side effect that the record appears in the TYPO3 backend and if you want to edit it, you get an error message that the UID must not be 0. So just do it via PHPmyadmin...
And you have to make sure that the value passed to course is not NULL but "0" when building the URL.

How to get a full_html textarea field in a Drupal 8 configuration form?

In my module I have a configuration form (ConfigFormBase) with a simple textarea field without formatting that works correctly.
$form['page_message'] = [
'#type' => 'textarea',
'#title' => $this->t('Message'),
'#description' => $this->t('Message display to customer contacts.'),
'#default_value' => $config->get('page_message'),
];
But I would like a textarea full_html field.
Is this possible and how with Drupal 8?
Yes it is possible, but you have to do it like this:
$form['page_message'] = [
'#type' => 'text_format',
'#title' => $this->t('Message'),
'#format' => 'full_html',
'#description' => $this->t('Message display to customer contacts.'),
'#default_value' => $config->get('page_message'),
];
You can check Drupal api for TextFormat.php here, just click on view source and you will have all the info you need.

Creating Salesorder with Vtiger Webservice missing Tax

I have the Problem when creating an salesorder with Vtiger Webservice,
The sales order is created but somehow the tax is not added.
I thought it has something to do with the parameter : hdnTaxType
Cause even if I add this value 'group' it does not apply the Tax to the Salesorder.
I have to manually add The Taxtype 'group' then the system adds the tax.
thats why i tried to add values like:
'tax1' => '7.00',
and
'group_tax' =>[
'group_tax_percentage1' => '7.0'
],
nothing so far did help...
has anybody an Idea what the problem is?
Thank you
Tobi
$salesOrder =[
'lastname' => $customer['lastname'],
'subject' => 'Order from 01.01.1018',
'sostatus' => '1',
'assigned_user_id' => '',
'bill_street' => 'Rechunngsstrasse 123',
'ship_street' =>'Lieferungsstrasse 123',
'productid' => '14x4325',
'currency_id' => '21x1',
'carrier' => 'DHL',
'txtAdjustment' => '13',
'salescommission' => '12',
'exciseduty' => '15',
'hdnTaxType' => 'group',
'tax1' => '7.00',
'hdnS_H_Amount' => '22.22',
'group_tax' =>[
'group_tax_percentage1' => '7.0'
],
'LineItems' => [
0 => [
"taxid" => "33x1",
'productid'=>'14x6',
'listprice'=>'20.53',
'quantity'=>'3',
'comment' => "Product123"
]
]
Webservices in Vtiger are not complete.
In this case you can register your own webservice that makes your queries, or check the SalesOrder in the after-save event

Calabash: Get state of toggle switch

I am trying to get the state of a toggle switch in my native app.
This is the query of the switch itself, when ON:
query "Switch id:'quadrant_buzz'"
and its results
[
[0] {
"class" => "android.widget.Switch",
"tag" => nil,
"description" => "android.widget.Switch{29ddf658 VFED..C. ........ 877,0-1017,81 #7f10017f app:id/quadrant_buzz}",
"id" => "quadrant_buzz",
"text" => "",
"visible" => true,
"rect" => {
"height" => 81,
"width" => 140,
"y" => 1303,
"x" => 877,
"center_x" => 947,
"center_y" => 1343
},
"enabled" => true,
"contentDescription" => nil
}]
This is the result of the query when the switch is OFF:
[
[0] {
"class" => "android.widget.Switch",
"tag" => nil,
"description" => "android.widget.Switch{29ddf658 VFED..C. ........ 877,0-1017,81 #7f10017f app:id/quadrant_buzz}",
"id" => "quadrant_buzz",
"text" => "",
"visible" => true,
"rect" => {
"height" => 81,
"width" => 140,
"y" => 1213,
"x" => 877,
"center_x" => 947,
"center_y" => 1253
},
"enabled" => true,
"contentDescription" => nil
}]
I am unsure how to check for its on/off state. When I tap/touch the switch, nothing changes in the returned query. The only difference I see is the center-y.
Is there something in the Calabash Api for this?
Thanks
Looking up the documentation for a Switch widget on Android developers it is the method "isChecked". http://developer.android.com/reference/android/widget/Switch.html
Therefore you can find this value in Calabash by invoking
query("Switch id:'quadrant_buzz'", :isChecked)
You could also used just :checked in Calabash.
The isChecked works.
irb(main):001:0> query("android.widget.Switch",:isChecked)
[
[0] true
]

How to add and remove class from marker using gmaps4rails gem?

Below is my controller code for create new marker
#vnote_hash = Gmaps4rails.build_markers(#vnotes) do |vnote, marker|
marker.lat vnote["latitude"]
marker.lng vnote["longitude"]
marker.json({:trip_vnote_id => vnote["id"] })
marker.picture({
"url" => "images",
"width" => SHOW_SMALL_THUMB_IMAGE_WIDTH,
"height" => SHOW_SMALL_THUMB_IMAGE_HEIGHT})
end
in short, i want to do like differentiate click marker and un-click marker.