Displaying fancy routes in cloudmade based service - javascript

I look for a way to display a route in a fancy way using the Cloudmade service.
Currently, I can see computed routes like on this tutorial http://developers.cloudmade.com/projects/web-maps-lite/examples/routing, but I look for a fancier way to do it -- without A and B tags, and with colors, etc.
Is this possible ?
Thanks for your help
Rob

Currently this is not possible unfortunately, the only way to do this is to use the NavEngine API directly and process the JSON responses manually. But we will think about making the CM.Directions class more configurable in future releases, thanks!

Related

NestJs: Is there a way to generate a resource, already wired to a TypeOrm entity?

I'm playing around with NestJs, for the purpose of automating REST API creation as much as possible. So far, I do not see any quick way to create a fully functional resource.
For example, if I use the Nest CLI like this:
nest g resource
And call my resource "posts", I get a module, a controller, a service, dto's and an empty entity
In order to make it functional, I would need to manually go through every method of the PostsService, remove the placeholder, and wire it to the corresponding entity method. For example, this needs to be altered:
findAll() {
return `This action returns all posts`;
}
to:
findAll(){
return this.postsRepository.find()
}
Not to mention, that I need to add various decorators and imports. In my opinion, this undermines the whole idea of CRUD generator. A lot of files are created for me, but they need to be altered.
Is there any way in Nest to create a fully functioning resource(of course i would still need to manually set the fields of the entity), with all parts wired to each other correctly?
I also tried to find something similar. And this is the best what I found https://github.com/ashinzekene/generator-nestjs-app
I think if such a thing existed, then it should have been mentioned in this repository. https://github.com/nestjs/awesome-nestjs
But it's not. Maybe I'm wrong 😑
The purpose of nest isnt to get up and running asap -> You would probably want to use something a little bit more user friendly / or one with a more guided workflow.
in terms of what the generator is giving you...
Controller Only deals with the request / response being recieved and sent... it doesnt have any other type of functionality...
DTO think of it like an interface but with more functionality , as you can add data-validation / etc to make sure the request object is formated properly...
Service Exposes the methods that contain all of our business logic. for a crud app, this would be where your actual get post put patch delete would be ... and how the data us modified in your db. Then once this finishes it would return the response if any to the controller which sends the info out.
this is helpful for many reasons... one if our project has 200 endpoints and 40 people working in different teams you dont want each team to have a different way of doing things, also you want it to be clear where each thing is... if you endpoints need to be changed , you simply go to your controller... if the logic needs to change, you go to that service etc...
The Purpose of nest is to give you a framework for extremely modular apps / essentially everything decoupled..
think of it in terms of an express... you could have a single page express app that just has everything in one place... or you could have every single thing on it's own area...
esentially nest doesnt do anything crazy that express cant, it's just the underlying inversion of control (the .main file which calls the app.module which builds all the different pieces that are needed for that endpoint / app / service / or etc.)
If you just want to use nest because it seems shiny , id consider looking up something like fastify or / even appsmith / or something else like that...

Have multiple URIs with parameters in routes.js using MEAN

I want to be able to use get methods in my MEAN API, i have the following code in my index.js:
router.route('/platillos/:id')
.get(PlatilloCtrl.getPlatillosById)
.post(upload.array(),PlatilloCtrl.addComentario)
.put(upload.array(),PlatilloCtrl.updatePlatillo)
.delete(PlatilloCtrl.deletePlatillo);
and I made this one too:
router.route('/platillosC/:categoria')
.get(PlatilloCtrl.getPlatillosByCategoria);
I would like to have the category and the id in the same URI withouth having an extra one.
Is there a way to do this?
Without knowing exactly what you're using in terms of a routing solution, most libraries will accept and parse multiple parameters, ie:
router.route('/platillosC/:id/:categoria')

Dynmaic Fields - Admin on Rest

currently I'm searching for a mechanism to creat dynamic fields in the admin on rest - framework. The input-environment should look like the example in the linke below.
https://bootsnipp.com/snippets/featured/dynamic-form-fields-add-amp-remove
I want to use it to create an 1:n or m:n relation and I'm seachring for a possibility to realise it by the framewok directly or (second choise) by a react an component.
Does anybody know if there is a possbility by the Framework? I could't find anything.
Thanks
So as Base to solve my Prolem I found this discussion
https://github.com/marmelab/admin-on-rest/issues/695
I think with hind it's possible to get it

What is the best way to handle i18n in an Angular app with dynamic translations

So I have been tasked with i18n on a new Angular app we are creating. I already know how to implement it if the translations are stored in json format on the client. However I have been told I cannot implement it like this as the translations will get updated on a regular basis by the client so must will have to be got from the api.
I have also been told that I cannot map directly to the json response, but instead I must create TypeScript objects which sit between the json and the UI.
What is the best way to achieve this? The header has a dropdown for languages. Do I need to call all the languages when the application loads and cache them, or do I just call each language as I need to? Do I translate only what I see on screen or does the entire app need to be translated?
do I just call each language as I need to
Definitely only the ones you need.
Do I translate only what I see on screen or does the entire app need to be translated
The relevant portions get redirected to an in memory i18n angular service that has the results cached.

JavaScript: Using OmniGrid with loadData

I'm trying to work with the nice OmniGrid control.
Everything is great when I'm setting a URL for an ASP.NET handler that returns an answer.
My problem starts when I'm trying to use the data provider.
I was breaking my fingers trying to find a piece of information of how to use the data provider (can't find the appropriate format of the table content result).
Anyone familiar with such tutorial/example?
My I know how you are trying to integrate it in your pages? and what kind of backed u have to bind?

Categories

Resources