I am using the plugin in a desktop application (Visual Studio C#). I am creating a placemark using the following code:
// Create a new coordinate object based on the lat/lon of the device
// TODO :: add lat/lon once data is available
FC.GEPluginCtrls.Geo.Coordinate Coord =
new FC.GEPluginCtrls.Geo.Coordinate(0, 0, 0, AltitudeMode.RelativeToGround);
// Create a placemark and put it in the tree.
kmlTreeView.ParseKmlObject(KmlHelpers.CreatePlacemark(
ge,
Coord,
((Device)DeviceList[i]).sSerialNum, // ID
((Device)DeviceList[i]).sNickname, // Name - shown in tree
((Device)DeviceList[i]).sName)); // Description - shown in bubble
In the TreeView the new nodes show up and when I double-click on them the bubble pops up with information in it but the view does not change. I attempted to verify the property "public bool FlyToOnDoubleClickNode" as shown in the documentation but that property apparently does not exist in the version I am using (1.010).
When I was loading a KML file the double click worked as expected but ever since I've been manually adding the placemarks it does not work.
Any thoughts?
Thanks!
Have you tried manually assigning a <LookAt> or <Camera> ?
That should work
Edit: Well the FlyToOnDoubleClickNode is turned on by default, so your problems lie elsewhere
I do not know why you are having troubles with setting multiple LookAts. Have you tried assigning 'ids' to your LookAt ? Depending on what you are actually doing, that might help.
Otherwise, have you seen setFlyToView()
I am not sure that will help you though, since it relates to KMLs loaded via NetworkLinks
Thats about me for ideas - good luck!
It appears that the coordinates 0,0 are somehow significant. If the coordinates are changed to something else the "FlyTo" works (0.1 and 0.1 work).
Related
I'm working on a script that does find/replace for missing items in your project. Unfortunately I'm running into a situation detecting and then replacing layered image sources (psd, ai, etc.).
1) I see no way of detecting if a AvItem is a layer within a layered image other than parsing the item.name, which is unreliable because a user can always rename items in the project panel.
2) Once I do know that it is a part of a layered image I cannot figure out how to re-link it to the correct image without replacing the layer with the merged image. item.replace(new_path) will replace that item with the whole image, not the layer within the image. For example:
var item = app.project.item(3); //assuming this is the 'layer' we want to replace
item.replace(new_path);
So is there a secret property somewhere which will reliably tell me if an item is a part of a layered image, and if so is there a way to relink it without replacing the layer with the entire merged image?
EDIT
Here's a function to guess if a layer is part of a layered image. It's not bullet-proof but it should work as long as the user does not rename the item:
function isSourceLayered (av_item) {
// check if there is a "/"
if (av_item.name.indexOf("/") != -1) {
// check if it is in a "layers" folder
if (av_item.parentFolder.name.indexOf("Layers") != -1) {
return true;
}
}
return false;
}
I just asked the same question on the Adobe extendscript forum. Unless there's undocumented features (and I spent a bit of time looking with Extendscript Toolkit's data browser) the fileSource object doesn't seem to have any attributes or methods to do this.
There is a kind of a workaround, you can import the file using ImportOptions.importAs(ImportAsType.COMP) This will import a comp, and you can loop through the layers matching the name, get the source of that layer and use that as your new source. But as you say, it doesn't work if the source has been renamed.
I've written this into a function, it's available on github Edit: I forgot that I changed the way that function works. It doesn't re-import layer sources because of this problem, it just uses the Duplicate menu command.
I´m using the DirectionsService to generate some routes, but i want to change the default letter markers that Google provides (A, B, C, ...) with some of my own. I was able to do this following this example: http://googlemaps.googlermania.com/google_maps_api_v3/en/map_example_direction_customicon.html
I removed the provided markers, obtained the coordinates of the steps an generated the new markers at those locations, so far so good.
My problem is that the route is draggable, so when the marker is dragged, the route must be dragged too, but cant´find a way to link-attack the marker to the route. Any ideas?
You can render the direction as polyline, then you can use as marker what you want. This example was for other targets and is for your request maybe a little bit big, but it shows how it can be done (Gmap study: multi auto routes/direction with unlimited waypoints click by click)
Hi there i'm using JMapViewer to show maps in my swing app and I've successfully created a panel with map tiles on it but these map tiles are of a particular area used in demo source of Map Viewer, i'm confused about how can i show the tiles of some particular area i want. Just like Google maps i want to show some location of my country (Pakistan) in the maps and i don't know how can i do it.
Secondly, Please explain what are Layer's and Layer Group in JMapViewer? Just an idea.
Edit: how can i download tiles of Islamabad region and then add them to maps.
What i've learnt from demo is this:
private void loadMapTiles(){
map().setTileSource(new OsmTileSource.Mapnik());
map().setTileLoader(new OsmTileLoader(map()));
}
But this shows some specific area they have set to.
I've downloaded JTileDownloader but i'm confused about the url thing because i don't now where to get the url of some specific area.
Given a JMapViewer named map, something like this should display Islamabad:
Coordinate c = new Coordinate(33.7167, 73.0667);
map.setDisplayPosition(c, 10);
org.openstreetmap.gui.jmapviewer.Demo, included in the distribution, is a complete example that illustrates how to use Layer. Click the Tree Layers Visible checkbox to see the effect.
Addendum: Here's the result using MapQuest-OSM at 11x zoom; Mapnik seems to work, too. If no TileSource includes the tiles you want, you may need one of the approaches mentioned here.
I have a little problem that i think it's easy so get a solution, but i've come to the point of trying everything and still not working. I'm sure it something simple, so i'm asking help as i can't figure it out on my own.
I have a qvtkwidget on the centralwidget and it has no problem.
the problem is that every time i run the program it rends another box apart from the interface.
here's the part of my code that matters for this issue.
// Create renderer
ren= vtkRenderer::New();
ren->AddActor(outlineActor);
ren->SetBackground(0.1,0.1,0.3);
// Drawing some X,Y,Z axes
axes= vtkCubeAxesActor2D::New();
//more stuff
ren->AddViewProp(axes);
ren->ResetCamera();
// Create a window for the renderer
renWin= vtkRenderWindow::New();
renWin->AddRenderer(ren);
// Set an user interface interactor for the render window
iren= vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
style = vtkInteractorStyleTrackballCamera::New();
iren->SetInteractorStyle(style);
// Create a inicial camera view
vtkCamera *inicam= ren->GetActiveCamera();
inicam->Zoom(1);
inicam->SetViewUp(0, 0, 0);
inicam->Azimuth(45);
ren->ResetCameraClippingRange();
// Start the initialization and rendering
renWin->Render();
// Assign the rendering window to the qvtkwidget
ui->qvtkWidget->SetRenderWindow(renWin);
if someone as any idea about this i would appreciate.
QVTKWidget already has an interactor. So use that one instead:
auto interactorStyle = vtkSmartPointer<TestInteractorStyle>::New();
QVTKInteractor* interactor = widget->GetInteractor();
interactor->SetInteractorStyle(interactorStyle);
after seeing the example i got it to work.
ui->qvtkWidget->GetRenderWindow()->AddRenderer(ren);
this seems pretty specific to ask - but there was no other alternative to the expertbase of stackoverflow!
I'm stuck in a problem where I need to control the radius of the circle by an external means such as a dropdown or a textbox.
I had a hard time doing the circle and had to copy stuff from the Twitter search example on:
http://code.google.com/apis/maps/articles/mvcfun/twittersearch.html
Ideally, I would like to know how to bind an external even to the radiusWidget, the problem is - the sizer inside the radiusWidget seems a private entity.
It would be awesome if someone could hit me in the face with a bang!
Thx
distanceWidget.set('distance', XXX) should work. If you read the MVC article you can see how the binding is bi-directional.
You can look at the source of the Twitter example by downloading it to your computer, as you likely already did. When you have the source you can adapt it to your purposes as you like. The software usage rights (terms of usage, license, etc), if they are any, have to be respected of course.
In the case of the RadiusWidget you would just do:
function RadiusWidget(opt_distance) {
// ...
this.sizer = this.addSizer_(); // sizer is now accessible in RadiusWidget
}
RadiusWidget.prototype.addSizer_ = function() {
var sizer = ...
// ...
return sizer;
}