How to set a LocationRectangle on Universal Windows Platform map control? - dictionary

I am developing an app in which I have a Map control! On this map, I am adding custom pushpins via map.Children property. How can I set a LocationRectangle and then zoom on it? Because I want my pushpins not to be out of the screen size. I want the map to zoom on a level in which all of the pins will be on the screen!

You can use the MapControl's TrySetViewBoundsAsync method. This method allows you to specify a bounding box of the area you want to display (which you can calculate by finding the the farthest pushpins in all directions, which will give you the north-west and south-east corner of the area), a potential margin and a map animation to use while the view is being changed.
You can find more details about the method in the documentation.

Related

Add marker/dot on image at accurate pixel with zoom in/out functionality

I'am using reactJS and want to design a component with following functionality :
Display pixelated image which is able to zoom in and zoom out at pixel level.
When clicked on image , display a marker- which can be a dot or icon at specific position.
When image is zoomIn/zoomOut, marker size and position should not change.
Even after zoomIn/zoomOut when clicked on image, marker should get repositioned at proper pixel on the image.
I am thinking of applying same logic as used in the maps/ leaflet. Like they maintain separate layers for map and markers on the map. If we zoomIn/out maps it won't affect the marker position or size, same functionality I want for the image.
Anyone with the solution or related library will be welcomed !
(For reference, I want this design for marking GCP(Ground Control Points) on the image, which requires very precise marking at pixel level)

how to calculate zoom level in here android SDK

I have a request that want to know the zoom level that can just bring a position(GeoCoordinate) into current map view rect with a specific transform center.
Is there a method to calculate this zoom level in one time? but not use looply a small zoom step to try setZoom and later check if this point is still in the view rect throgh ProjectToPixel function.
This will do:
Map#zoomTo(GeoBoundingBox, ViewRect, Animation, Orientation)
It will directly move the map to a geoarea given a view rectangle. You can center the view rectangle at the transform center you wanted. The GeoBoundingBox is your current geo view port expanded to fit the position you want to fit in.

Clickable Map Grid Overlay

I am trying to create a map grid using Google maps. I have a fixed border frame and need to create an overlay on top, similar to this and this example. However, I also need to be able to hover over map tiles using the mouse cursor and change the hue/saturation of the overlay elements accordingly. Each element in the grid will have an onClick() event associated with it.
After some research I found libraries that can be used to draw a grid such as OSMatrix.I also noticed that one of the d3.js examples is somewhat similar to what I am aiming to achieve. The question is, how can I add the visualization as an overlay on top of a map and is it possible to accomplish with API v3 and JavaScript?

sketchup insert group in constrained zone

I created a sketchUp plugin that draws a wall (with lenght, width and height).
Now I would like to insert a "window" in that wall (fixed length, width and height, depending on the wall). How can I:
Create but not yet draw the group containing the window. Link it to the current mouse position
Constrain the current mouse position to the front plane of the wall I drew before
When the user clicks, the window is inserted and the group is shown
The easy way to do it, that doesn't fulfill your request 100% - but do use existing SketchUp conventions, is to create a component definition and then use Model.place_component to activate SketchUp's native tool to position a new component instance.
In order to fulfill your question 100%:
A Group is an instance. You cannot create one and not place it in the model. You can create it in step 3 when the user clicks. (Though, a window sounds like a candidate for a component since you usually have multiple copies of the same window type.)
You cannot constrain the mouse cursor itself, but if you implement a custom Tool and make use of the InputPoint class you can selectively determine what is a valid insertion point when the user clicks. You can also draw virtual lines and polygons to the viewport to give a preview of your window.
Profit!

How can i set size of openInfoWindowHtml in google Map

Please help me to change size of openInfoWindowHtml in google map and plez tell me can i make it popup out of map area also..? i mean my map area is very small but i want that when user click on Marker this openInfoWindowHtml should show popup and if its crossing size of map than its should show beyond the boundary of google map. ( i am working in asp.net)
There are 2 ways that you can influence the size of the InfoWindow. First, you can pass a GInfoWindowOptions object when you call openInfoWindowHtml (see: http://code.google.com/apis/maps/documentation/reference.html#GInfoWindowOptions) Second, you can wrap the contents of the InfoWindow in a div and use CSS to set the size of that div.
Regardless of which method you use to set the size of the InfoWindow, it can never exceed the bounds of the map canvas (area).

Resources