Yandex Maps: how change styles placemark from api 1.0 to 2.0 - yandex

I have this styles in api 1.0
var s = new YMaps.Style();
s.iconStyle = new YMaps.IconStyle();
s.iconStyle.offset = new YMaps.Point(-1, -30);
s.iconStyle.href = "http:www.example.com/images/1.png";
s.iconStyle.size = new YMaps.Point(29, 28);
s.iconStyle.shadow = new YMaps.IconShadowStyle();
s.iconStyle.shadow.offset = new YMaps.Point(2, -12);
s.iconStyle.shadow.href = "http:www.example.com/images/2.png";
s.iconStyle.shadow.size = new YMaps.Point(29, 7);
here I add this styles to placemark
var placemark = new YMaps.Placemark(new YMaps.GeoPoint(lat, long),
{hasBalloon: false,
style: s
});
placemark.setHintContent(mystring);
placemark.enableHint();
map.addOverlay(placemark);
how create this styles in api 2.0 ?

I solve like this :
placemark.options.set('iconImageHref', 'http:www.example.com/images/1.png');
placemark.options.set('iconImageOffset', [-1, -30]);
placemark.options.set('iconImageSize', [28,29]);
placemark.options.set('iconShadowImageHref', 'http:www.example.com/images/2.png');
placemark.options.set('iconShadowImageOffset', [2, -12]);
placemark.options.set('iconShadowImageSize', [29, 7]);

Related

Babylon js texture issue when used with reactjs

I'm implementing 3D demo application using Babylonjs library for 3D Demo.I'm importing 3D model from S3 and adding texture image on top of material in Reactjs.
But when i add texture image on top of material, rest of area on 3D model gets black color and i want get rid of it. Code works fine in Babylon playground but fails in React app.
Here is the source code
var mat = new BABYLON.CustomMaterial("mat", scene);
mat.diffuseTexture = new BABYLON.Texture(textureImage, scene, false, false);
materialedMeshes.forEach(mesh => mesh.material = mat);
mat.emissiveColor = new BABYLON.Color3(1, 1, 1);
// mat.diffuseColor = new BABYLON.Color3(1, 0, 1);
// mat.specularColor = new BABYLON.Color3(0.5, 0.6, 0.87);
// mat.emissiveColor = new BABYLON.Color3(1, 1, 1);
// mat.ambientColor = new BABYLON.Color3(0.23, 0.98, 0.53);
mat.diffuseTexture.uOffset = -0.1000;
mat.diffuseTexture.vOffset = -1.1800;
mat.diffuseTexture.uScale = 1.2200;
mat.diffuseTexture.vScale = 2.2200;
mat.diffuseTexture.uAng = Math.PI;
mat.diffuseTexture.wrapU = BABYLON.Constants.TEXTURE_CLAMP_ADDRESSMODE;
mat.diffuseTexture.wrapV = BABYLON.Constants.TEXTURE_CLAMP_ADDRESSMODE;
mat.Fragment_Custom_Alpha(`
if (baseColor.r == 0. && baseColor.g == 0. && baseColor.b == 0.) {
baseColor.rgb = vec3(0.85, 0.85, 0.85);
}
baseColor.rgb = mix(vec3(0.85, 0.85, 0.85), baseColor.rgb, baseColor.a);
`)

Add text to picture in Windows Universal app

I have universal app created for Win 10 mobile which captures photo. I want to add stamp (some text) to my photo. Is it possible? It seems working with bitmap is really difficult in universal applications
Check this link:
How to add wartermark text/image to a bitmap in Windows Store app
Or better use Win2D library (you can find it on NuGet) and snippet like this:
CanvasDevice device = CanvasDevice.GetSharedDevice();
CanvasRenderTarget offscreen = new CanvasRenderTarget(device, 500, 500, 96);
cbi = await CanvasBitmap.LoadAsync(device, "mydog.jpg");
using (var ds = offscreen.CreateDrawingSession())
{
ds.DrawImage(cbi);
var format = new CanvasTextFormat()
{
FontSize = 24,
HorizontalAlignment = CanvasHorizontalAlignment.Left,
VerticalAlignment = CanvasVerticalAlignment.Top,
WordWrapping = CanvasWordWrapping.Wrap,
FontFamily = "Tahoma"
};
var tl = new CanvasTextLayout(ds, "Some text", format, 200, 50); // width 200 and height 50
ds.DrawTextLayout(tl, 10, 10, Colors.Black);
tl.Dispose();
}
using (var stream = new InMemoryRandomAccessStream())
{
stream.Seek(0);
await offscreen.SaveAsync(stream, CanvasBitmapFileFormat.Png);
BitmapImage image = new BitmapImage();
image.SetSource(stream);
img.Source = image;
}

StageText - How to use more than 1 StageText field?

I'm using Flash CS 6 and Air 3.6 to build an Android app.
I would like to use StageText for the input fields.
The code below is only working for the first textfield. What do I need change to make it work for both text fields?
// NO. 1
var firstfield:StageText = new StageText();
firstfield.softKeyboardType = SoftKeyboardType.DEFAULT
firstfield.stage = foobar.stage
firstfield.viewPort = new Rectangle(foobar.x, foobar.y, foobar.width, foobar.height);
// NO. 2
var secondfield:StageText = new StageText();
secondfield.softKeyboardType = SoftKeyboardType.DEFAULT
secondfield.stage = example.stage
secondfield.viewPort = new Rectangle(example.x, example.y, example.width, example.height);
Try something like this:
var firstfield:StageText = new StageText();
firstfield.softKeyboardType = SoftKeyboardType.DEFAULT
firstfield.stage = this.stage;
firstfield.viewPort = new Rectangle(0, 0, 200, 30);
firstfield.x = 0;
firstfield.y = 0;
firstfield.width = 200;
firstfield.height = 30;
addChild(firstfield);
var secondfield:StageText = new StageText();
secondfield.softKeyboardType = SoftKeyboardType.DEFAULT
secondfield.stage = this.stage;
secondfield.viewPort = new Rectangle(0, 40, 200, 30);
secondfield.x = 0;
secondfield.y = 40;
secondfield.width = 200;
secondfield.height = 30;
addChild(secondfield);

ArcGIS Runtime for wpf - PointDataSource mapTip

I have GraphicsLayer in my application and I use PointDataSource like itemsSource:
trackEntryPointDataSource = new PointDataSource();
trackEntryPointDataSource.DataSpatialReference =
new SpatialReference((int)CommonEpsgCodes.JTSKEN);
trackEntryPointDataSource.XCoordinateBinding =
new System.Windows.Data.Binding("XJTSK");
trackEntryPointDataSource.YCoordinateBinding =
new System.Windows.Data.Binding("YJTSK");
SimpleRenderer srd = new SimpleRenderer();
srd.Symbol = new SimpleMarkerSymbol()
{
Color = new SolidColorBrush(Colors.Yellow)
};
EntriesLyr.GraphicsSource = trackEntryPointDataSource;
EntriesLyr.Renderer = srd;
Have someone any idea how to add MapTips to graphics symbols?
GraphicsLayer class has a MapTip property.
A detailed example if found here

Exchange Web Services Create Meeting Request Working Example

Is there a working example anywhere of how to create a meeting request using EWS for Exchange 2007 using C#? Which properties are required? I have added a web service reference and can connect to create and send various items but keep getting the error "Set action is invalid for property." on the response messages. It never says what property is invalid
var ews = new ExchangeServiceBinding {
Credentials = new NetworkCredential("user", "pass"),
Url = "https://servername/ews/exchange.asmx",
RequestServerVersionValue = new RequestServerVersion {
Version = ExchangeVersionType.Exchange2007}
};
var startDate = new DateTime(2010, 9, 18, 16, 00, 00);
var meeting = new CalendarItemType {
IsMeeting = true,
IsMeetingSpecified = true,
Subject = "test EWS",
Body = new BodyType {Value = "test body", BodyType1 = BodyTypeType.HTML},
Start = startDate,
StartSpecified = true,
End = startDate.AddHours(1),
EndSpecified = true,
MeetingTimeZone = new TimeZoneType{
TimeZoneName = TimeZone.CurrentTimeZone.StandardName, BaseOffset = "PT0H"},
Location = "Meeting",
RequiredAttendees = new [] {
new AttendeeType{Mailbox =new EmailAddressType{
EmailAddress ="test1#domain.com",RoutingType = "SMTP"}},
new AttendeeType{Mailbox =new EmailAddressType{
EmailAddress ="test2#domain.com",RoutingType = "SMTP"}}
}
};
var request = new CreateItemType {
SendMeetingInvitations =
CalendarItemCreateOrDeleteOperationType.SendToAllAndSaveCopy,
SendMeetingInvitationsSpecified = true,
SavedItemFolderId = new TargetFolderIdType{Item = new DistinguishedFolderIdType{
Id=DistinguishedFolderIdNameType.calendar}},
Items = new NonEmptyArrayOfAllItemsType {Items = new ItemType[] {meeting}}
};
CreateItemResponseType response = ews.CreateItem(request);
var responseMessage = response.ResponseMessages.Items[0];
Microsoft provides an XML example at http://msdn.microsoft.com/en-us/library/aa494190(EXCHG.140).aspx of what the message item should look like. Just setting these properties does not seem to be enough. Can someone tell me what I'm missing or point me to some better examples or documentation?
<CreateItem
xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
SendMeetingInvitations="SendToAllAndSaveCopy" >
<SavedItemFolderId>
<t:DistinguishedFolderId Id="calendar"/>
</SavedItemFolderId>
<Items>
<t:CalendarItem>
<t:Subject>Meeting with attendee0, attendee1, attendee2</t:Subject>
<t:Body BodyType="Text">CalendarItem:TextBody</t:Body>
<t:Start>2006-06-25T10:00:00Z</t:Start>
<t:End>2006-06-25T11:00:00Z</t:End>
<t:Location>CalendarItem:Location</t:Location>
<t:RequiredAttendees>
<t:Attendee>
<t:Mailbox>
<t:EmailAddress>attendee0#example.com</t:EmailAddress>
</t:Mailbox>
</t:Attendee>
<t:Attendee>
<t:Mailbox>
<t:EmailAddress>attendee1#example.com</t:EmailAddress>
</t:Mailbox>
</t:Attendee>
</t:RequiredAttendees>
<t:OptionalAttendees>
<t:Attendee>
<t:Mailbox>
<t:EmailAddress>attendee2#example.com</t:EmailAddress>
</t:Mailbox>
</t:Attendee>
</t:OptionalAttendees>
<t:Resources>
<t:Attendee>
<t:Mailbox>
<t:EmailAddress>room0#example.com</t:EmailAddress>
</t:Mailbox>
</t:Attendee>
</t:Resources>
</t:CalendarItem>
</Items>
</CreateItem>
This is probably too late for you, but this for anyone else trying this.
The issue seems to be with providing the Is-Specified params. I deleted the IsMeetingSpecified and the request worked. Here's the revised CalendarItemType.
var meeting = new CalendarItemType
{
IsMeeting = true,
Subject = "test EWS",
Body = new BodyType { Value = "test body", BodyType1 = BodyTypeType.HTML },
Start = startDate,
StartSpecified = true,
End = startDate.AddHours(1),
EndSpecified = true,
MeetingTimeZone = new TimeZoneType
{
TimeZoneName = TimeZone.CurrentTimeZone.StandardName,
BaseOffset = "PT0H"
},
Location = "Room 1",
RequiredAttendees = new[] {
new AttendeeType
{
Mailbox =new EmailAddressType
{
EmailAddress ="test#test.com"
}
},
}
};

Resources