Create a route from 42.108311,-8.618618999999999 to 52.2947946,11.6822273. I try to drag the route from Villadolid to road N-610, screen https://snipboard.io/CR6wVn.jpg , pre-drawn correctly. After releasing the mouse button,the route is different, there is a turn easter of Cuenca de Campos, screen https://snipboard.io/VWJ1vL.jpg. How can only the main roads when used drag?
Drag request like this
https://fleet.ls.hereapi.com/2/calculateroute.json?xnlp=jsonAttributes%3D41&app_id=***&app_code=***&apikey=***&mode=truck%3Bfastest%3Btraffic%3Adisabled&language=en-GB&representation=overview&metricSystem=metric&routeattributes=wp%2Csc%2Csm%2Csh%2Cbb%2Clg%2Cno%2Cshape&legattributes=wp%2Cmn%2Cli%2Cle%2Ctt&maneuverattributes=po%2Csh%2Ctt%2Cle%2Cti%2Cli%2Cpt%2Cpl%2Crn%2Cnr%2Cdi&linkattributes=sh%2Cle%2Csl%2Cds%2Ctr&instructionformat=html&trailersCount=0&alternatives=0¤cy=EUR&trailerType=2&vehicleNumberAxles=2&trailerNumberAxles=3&hybrid=0&emissionType=5&height=4m&trailerHeight=400&vehicleWeight=8000&limitedWeight=40t&width=225&length=16.5m&disabledEquipped=0&minimalPollution=0&hov=0&passengersCount=1&commercial=1&heightAbove1stAxle=300&fuelType=Diesel&detail=1&rollup=none%2Ccountry%3Btollsys&requestId=1629721987441&excludeCountries=CHE&truckRestrictionPenalty=soft&waypoint0=geo!42.1083257%2C-8.6184468&waypoint1=geo!42.037725092800514%2C-5.039375866201198&waypoint2=geo!52.2952544%2C11.6801417&jsoncallback=H.service.jsonp.handleResponse(12)
Related
Question
I'm working with Adobe Scene7 BasicZoomViewer and I'm looking for a way to tell the ZoomViewer to reset the zoom so that the user is no longer zoomed in on an image but instead will show the default "zoom" level.
What I've found
The closest thing I found to what I need is this reset property ZoomView.reset which "Resets the viewport when the frame (image) changes. If set to 0 it preserves the current viewport with the best possible fit while preserving the aspect ratio of the newly set image".
This looks close to something I need but it states that it will reset or preserve the aspect ratio when a new image has been inserted but I am not inserting new images.
Demo from Adobe
There is a button on the image that the API inserts into the page that resets the zoom level. Adobe provides a demo page that shows what I'm working with. If you look at the bottom left, the right-most button is the reset button. When clicked, it has to make some kind of API call and I need to figure out which one it is.
Edit
I've been able to find a minified version of the BasicZoomViewer and I am currently attempting to make sense of the code.
There is an event listener placed on the "Zoom Reset Button" that just simply calls a reset() method on line 274 in the uglified version of the file. Currently, I am trying to make sense of the file and figure out how to access this method.
c.zoomResetButton.addEventListener("click", function () {
c.zoomView.zoomReset()
});
I will be answering my own question. If someone finds a better way please feel free to answer as well.
tldr;
Create a variable to hold the instance of your s7viewers.BasicZoomViewer() and inside of that you can access the event handlers and much more.
Example of calling the reset zoom handler
// instantiate the s7viewers class and save it in a variable
var s7BasicZoomViewer = new s7viewers.BasicZoomViewer({
containerId: 's7viewer',
params: {
asset: assetUrl,
serverurl: serverUrl
})
// example of how to call the "zoomReset()" method
s7BasicZoomViewer.zoomResetButton.component.events.click[0].handler()
Explanation
After digging through the minified code that was uglified I found an event listener on the s7zoomresetbutton DOM class name, or perhaps it's watching for the ID of that DOM element which is the same ID as the container div for your S7 BasicZoom Viewer plus some added text to make this ID unique. For example, if the container div is s7viewer then the reset zoom button will have an ID of s7viewer_zoomresetbutton.
Now, going through the code I found this event listener which let me know there must be some way to call the zoomReset() method.
c.zoomResetButton.addEventListener("click", function () {
c.zoomView.zoomReset()
});
In the code above, the value of c is this or in other words it's the instance of your S7 BasicViewerZoom and in my case I have multiple depending on how many images I need to zoom on.
When instantiating the s7viewers class you can then reference that instance later and access the event handlers on each button and other properties and methods.
From there it was just looking through the object returned from the instance and calling the handler for the reset button.
I want to open all component-dialogs in a new windows or tabs. Is that possible and if yes, how can I do this?
I was thinking of modifying the edit handler of the component. How and where would I do this?
TL;DR:
Depending on what you want to do, it might not make sense, but, you could start here:
info.magnolia.ui.contentapp.detail.action.EditItemActionDefinition
info.magnolia.ui.dialog.formdialog.FormDialogPresenterImpl
maybe even https://www.magnolia-cms.com/blogs/boris-kraft/detail~&headless-or-full-bodied-cms--magnolia-provides-all-the-solutions~.html
Longer answer:
It depends on what you are trying to do - we can get to any state in Magnolia by re-using location fragments like this one: #app:contacts:detail;/ldavinci:edit
That tells me we are in edit mode on a particular path (from root of some workspace) in the detail subapp of the contacts app. What that means in this case is, we've opened a dialog in a tab.
Likewise: #app:contacts:browser;/ldavinci:treeview: represents another state.
So we can programmatically move to new locations if we know the parts of those location fragments. But these are locations (app,subapp,path) within Magnolia, not within a web browser.
A browser tab is not the same thing as a Magnolia tab; the latter represents a tab within a Magnolia form, and hasn't anything to do with a web browser - so it would not open.
Even if we did hijack that action, what you'll get in this case is the whole Magnolia rig, not just the dialog, standalone, in a new browser tab or window, which is not what I suspect you are interested in. If you are interested in the dialog, by itself, independent of the rest of the Magnolia UI, you might have to start looking at
info.magnolia.ui.dialog.formdialog.FormDialogPresenterImpl
146 public DialogView start(..
which calls
165 private void buildView(..
and sets up overlays, etc.
(sepcifically through 167 formPresenter.presentView(..)
...
so then if we look in here:
info.magnolia.ui.dialog.formdialog.FormPresenterImpl:
123 buildForm((FormView) this.formView, formDefinition, item, parent, activeLocale);
which eventually calls this guy
198 private void buildReducedForm(..
and it adds it to existing FormViewReduced (info.magnolia.ui.vaadin.form.FormViewReduced) with a certain modality.
FVR is implemented by
info.magnolia.ui.vaadin.form.Form
which is what should actually display the form.
and the form gets displayed on a
info.magnolia.ui.vaadin.tabsheet.MagnoliaTabSheet
So in info.magnolia.ui.vaadin.gwt.client.tabsheet.widget.MagnoliaTabSheetViewImpl:
...etc. and further on down the rabbit hole, and what would this stuff mean outside the context of Magnolia anyway?
I guess you could also look here:
info.magnolia.ui.contentapp.detail.action.EditItemActionDefinition
You can edit these data over our REST API anyway, so maybe you're trying to move the dialogs out of Magnolia to accomplish something along that line?
i have a problem on my map application, i am trying to put a coustom control on a Panorama and when users click to this custom button, panorama informations wll be saved.
For this purpose, i am using a function to check if there is a panaroma data exists
function checkforstreetview(mapid){
service.getPanoramaByLocation(markers[mapid].getPosition(), 50, function(r,status){
if(status==google.maps.StreetViewStatus.OK){
google.maps.event.addListener(markers[mapid], 'click', function (e) {
panorama[mapid].setVisible(true);
return false;
});
panorama[mapid].setPosition(markers[mapid].getPosition()); // custom control is moving to the left occurs here
}
});
}
as first, i am getting marker position on the map and check for panorama within 50m then if there is a panorama data, i am binding an click event to the marker for switching to panorama.
I am placing customdiv control via;
panorama[mapid].controls[google.maps.ControlPosition.TOP_CENTER].push(customdiv[0]);
Html markup of custom control is:
<div id="customdiv" title="Get data" style="height:10%;cursor:pointer;margin:0 auto;"><img src="/customdiv.jpg" style="height:100%;float:right;margin:5px;"/></div>
At the same time, i've assigned a function for drag and drop event for marker (with addlistener method), so if the marker drag'n drop to another position, checkforstreetview function is executed again.
So, what is the main problem?
In first execution there is no problem, when i click to the marker, panorama opens correctly and custom control is correctly placed but after close the panorama, drag'n drop marker to another position and click to marker again to show new panorama for new position, custom control moving to the left of panorama view.
Correct positioning (when system is initially loaded)
And buggy positioning (when i switch to panorama view in second time with marker click)
Extra information :
Because of google maps need to know height and width of container to work properly, i am using visibility: hidden rule for map container, not display:none but i think this cannot be problem bacause, on system load everything works correctly.
I've tested on Windows 7 / Firefox - Chrome - Opera - Safari - IE (lastest versions)
Tried solutions:
Many CSS hacks
Re-positioning custom control via google.maps.ControlPosition.TOP_CENTER
I've tried to put custom control to another positions BOTTOM_CENTER, LEFT_BOTTOM, .. etc but every time, custom control is moving to another position (shifting to the right, top, left )
Finally, i've commented out panorama[mapid].setPosition(markers[mapid].getPosition()); line and i've used standard packman to panorama/map switching then there is no problem on custom control positioning.
EDIT : Another interesting point is, after wrong positioning of custom control (and adress bar) when i click to next/previous arrows for next/previous images of panorama, custom control and adress bar becomes normal (correct position)
What can be the solution to stop shifting/moving costom control?
Thanks right now...
You cannot designate static CSS for the API, you must tell the maps API what you want your CSS to be (assign CSS properties in javascript):
https://developers.google.com/maps/documentation/javascript/examples/control-custom
I've resolved the issue by below function
google.maps.event.addListener(panorama[mapid], 'position_changed', function() {
google.maps.event.trigger(panorama[mapid],'resize');
});
I'm working to a BB application, using standard UI controls (Edits, Buttons, etc) - you can navigate through these controls using the trackball.
In a certain point I must open a BrowserField with an URL.
When I leave the BrowserField (and come back to the "standard UI controls" part, the pointer of BrowserField is still present on the screen, and the trackball cannot be used. From that point, I cannot use the application anymore.
I'm creating the OS 6 browser using following code:
final BrowserFieldConfig browserConfig = new BrowserFieldConfig();
browserConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE);
browserConfig.setProperty(BrowserFieldConfig.ENABLE_COOKIES,Boolean.TRUE);
browserConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR, Boolean.TRUE);
browserConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
BrowserFieldConfig.NAVIGATION_MODE_POINTER);
on exit, I don't have a specific code. I've tried with BrowserFieldConfig and NAVIGATION_MODE, to set back the default navigation mode, but it doesn't have any effect.
browserConfig = mWeb.getConfig();
browserConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,
BrowserFieldConfig.NAVIGATION_MODE_NODE);
[OS 6.0, BrowserField]
Tested with 9700, 9800 emulators, and to a 9900 real device.
I am developing an ASP.NET based website.
In a Master Page, I have a UL list, which is used to display links (akin to left nav). As of now, upon click of each li, the user is taken to respective page.
The problem is, when user is redirected to another page, the master page is also getting reloaded, as a result of which, the clicked-link is not highlighted. (All the UL is in a query accordion control).
Hence, I plan to use AJAX - i.e. whenever a user clicks a link in an accordion control, the corresponding page contents should be loaded and displayed in a place holder, so that the link is highlighted and user is aware of the current page info.
Please advise me as to how to achieve this (either thru' ASP.NET AJAX or Javascript AJAX)
The code in master page is as below:
script type="text/javascript">
// well all the DOM is written in the page and all elements are available do:
$(document).ready(function() {
// for each <a> tag bind the event click and now do:
$("a").click(function() {
// 1st. remove all selected
$("a.selected").removeClass("selected");
// 2nd. assign selected to this clicked element only
$(this).addClass("selected");
// 3rd. let's return true so the <a> tag can jump to the href
return true;
});
});
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
Haemostasis Kits
">Coaliza Anti-Cardiolipin
">Coamatic Antithrombin
">Coamtic LR-Antithrombin
">Coatest APC Resistance
">Coatest APC Resistance V
">Coatest APC Resistance V S
">V-DEF Plasma
">Coaset Factor VII
">Coamatic Factor VIII
">Coatest SP FVIII
">Coatest SP4 FVIII
">Coatest Heparin
">Coatest LMW Heparin/Heparin
">Coamatic Heparin
">Coamatic Plasmin Inhibitor
">Coamatic Plasminogen
">Coamatic Protein C
">Coalisa Protein S Free
Calibrators & Controls
">Calibration Plasma LMW Heparin
">Coatest APC Res. Contr. Plasma Lev.1
">Coatest APC Res. Contr. Plasma Lev.2
">Control Plasma LMW Heparin
Test 1
Chromogenic Substrates
S-2222
Test 3
Bio Reagents
Antithrombin 10 IU
">Cardio-FABP
Test 4
To have a feel of page, please visit:
http://www.murandmur.in/test2/Products/products-exclusive.aspx
Thanks for help in advance!
The way I went about doing more-or-less the same thing is to build a web service (or page method), which gets the body HTML from the DB and returns it (as a simple text string). This takes care of the server-side.
On the client side, use jQuery (which you use anyway) to make ajax calls to the web service.
I used these two links as reference when I was starting out:
http://encosia.com/using-jquery-to-consume-aspnet-json-web-services/
http://dotnetslackers.com/articles/ajax/Using-jQuery-with-ASP-NET.aspx
Hope this points you in the right direction.