Windows Phone 7 - Bing Maps MVVM Pushpin initialization - mvvm

Does anyone have a good guideline on how to initialize a pushpin on the Bing Maps control?
My current scenario works, but is not 100% correct... let me explain the details:
When I open the page with the Bing Maps control on it, I want the user to be able to push a small button that will show his current location.
To show the current location, I'm using a Pushpin. I'm already adding the Pushpin on the control in the XAML file like this:
<map:Pushpin> x:Name="currentLocation" Location="{Binding CurrentLocation}" Content="Me" ManipulationStarted="CurrentLocationPin_ManipulationStarted" </map:Pushpin>
Now with this scenario there a some problems!
One, the pushpin is always visible! So how do I go about this? ( I know I can bind the Visibility also to a property and use a bool to visibility converter, but is this the best way to do this? )
Secondly, now I don't initialize the Location in the viewmodel... but for semantic reasons I would love to initialize the default value to Geocoordinate.Unkown ( that way I can use this to do checks when the user tries to do some manipulation before a currentlocation is set ). But when I initialize the pushpin on startup I get following error: "UIElement.Arrange(finalRect) cannot be called with Infinite or NaN values in finalRect.". So my question again :) what is a good guideline to setting up a currentlocation pushpin? ( but do mind that the users has to push a small application bar button before the currentlocation is set )

The initialization problem is due to the visibility of the Pushpin. If the initial visibility of the Pushpin is Collapsed, then it won't take part in the arrange pass, so you won't get the error.
If you're using a view model to back this view, then I don't see a problem with exposing a property from the view model that determines whether the Pushpin should be visibile or not. Yes you could use a boolean to visibility converter, but you could save some processing by actually exposing a Visibility property (which is the approach I've used).
If you're using a command to initiate showing the Pushpin from the button push (the Silverlight Windows Phone Toolkit has a behavior to enable hooking up application bar buttons to commands).

Related

Flutter Mapbox clickable cluster annotations

I am trying to use Flutter mapbox_gl package to display clustered data, support for this functionnality has been added recently as showed in this example.
When the user zooms in, I would like to make symbols clickable, I have followed this example of clickable annotations but it seems not working, basically what I did is exactly combining the two examples: adding cluster layers (symbols and circles) using the map controller through onStyleLoadedCallback property, then adding on-click callbacks in my onMapCreated property (using onSymbolTapped & onCircleTapped methods). Am I doing something wrong?
For the clickable annotations from a source, as they come from a GeojsonSource, you must use onFeatureTapped. This will give you 3 data : the id (defined in the source), the point (coordinate on the screen) and the latlng (position on the map).
This allows you to set a generic callback for both the features in the source and the clusters made with it.
The package currently does not support having more data returned in the callbacks.

How to make window centered in GTK4?

In GTK3 there was a property on the Gtk.Window class called window-position. By setting this property to Gtk.WindowPosition.CENTER it was possible to tell the window to render in the center of the screen.
In GTK4 this property has been removed. How to achieve the same behavior in GTK4, i.e. how to make the main window of my application to be rendered in the center of the screen?
I checked the migration guide but I couldn't find the solution.
There is no replacement API, since it can't possibly work cross-platform, so it is broken API by definition. As such, it was removed.
For example: this is impossible to implement when running on top of a Wayland session, since the protocol doesn't allow getting/setting global coordinates. If you still want to have something similar working, you'll have to call the specific platform API (for example, X11) for those platforms that you want to support.

Get notified when user jumps to a marker (annotation) in Eclipse

I'm currently writing a plugin for the Eclipse IDE. In this plugin, I defined my own type of resource marker (IMarker). Using the standard Eclipse means like the "Next annotation"/"Previous annotation" buttons, the user has the possibility to navigate between these markers. I also wrote a view which shows some detail information for a single marker. This view shall be updated when the user navigates to a marker. Can I register some kind of listener/observer that will be notified when the user selects/jumps to a marker? If so, how? If not, what are my alternatives?
The Next Annotation action ends up calling the ITextEditorExtension4.gotAnnotation method. The usually implementation for this is in AbstractTextEditor. This just calls finds the annotation and calls the selectAndReveal method.
So there does not seem to be any special listener you can use for this. Normal selection events should be generated so you could use the ISelectionService selection listener but you will have to work out if the selection is for your marker.

Google Maps APi for iOS: UIActivityView on custom info window

I'm trying to put a spinner inside a custom info window that appears when the user presses a marker. I have a custom view for the window that has lots of subviews that show up fine. But when I try to add a UIActivityView or an animated PNG sequence, that doesn't show. Has anyone else experienced this?
The documentation on the mapView:markerInfoWindow: method says:
If you change this view after this method is called, those changes
will not necessarily be reflected in the rendered version.
It seems likely that the Google map is not showing the actual UIView you return, but a screenshot of it taken when the info window is returned by the delegate.
As mentioned in this answer, this is made explicit in the Android documentation - it seems likely that the Android and iOS SDKs work similarly.
If you've changed the view I'm not sure if there is a way to force the SDK to take a new screenshot of it. Possibly you could try setting the map's selected marker to nil and then back to your marker, to see if it then calls mapView:markerInfoWindow: again - although it might also re-centre the marker on the map when you do that. It also likely wouldn't be very efficient.
You can call mapView:markerInfoWindow: then inside the method you can create a UIView which you can add different controls on that UIView including the spinner. You can also specify on which location you would like to put the defined control.

SC.say location issue

I am currently facing an issue with fixing the location of SC.say pop up on the screen. The default behaviour of this pop up is okay, as in , it comes at the center of the screen. But then, once you drag this pop up to a corner of the screen, then , the next time when this pop up comes , it comes at that same corner where you had dragged it to. The default behaviour of this pop up (as far as the location is concerned) changes when the user starts dragging it. Is there a way to switch back to the default behaviour irrespective of where the user drags this pop up to?? I checked the javadoc of this SC class, but couldn't get any function that would let us specify the location where this pop up should come.
SmartGWT version : 3.0
GWT version : 2.4
Browser : Firefox,IE,Chrome,Safari
If you didn't find an easy solution to this, I think the easiest way is doing a "SC.say" by yourself.
it's very easy to replicate the built-in dialogs and then add your own functionality.
Something could help you
Canvas popUp = Canvas.getById("isc_globalWarn_body");
popUp.setTop(where it was);
popUp.setLeft(.......);
popUp.setWidth(...);
etc.....
I find the id with the console and the Canvas static method on a post somewhere on the net I don't remember where.