archive-com.com » COM » S » SVENNERBERG.COM

Total: 274

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • Calculating Distances and Areas in Google Maps API 3 | In usability we trust
    40 715 74 002 var distance 5576673 var heading 51 2145 var endPoint google maps geometry spherical computeOffset nyc distance heading var marker new google maps Marker position endPoint map map In this case endPoint will be the location of London which is LatLng 51 506 0 118 it differs slightly because I ve rounded the numbers With the computeOffset function we can get the end location if we know the starting point the heading and the distance Calculate a point in between Another useful function is interpolate which determines a point between two locations based on a fraction between 0 and 1 The fraction represents how far between two locations a point is So for example 0 5 is a point right in the middle between the start and end location var nyc new google maps LatLng 40 715 74 002 var london new google maps LatLng 51 506 0 119 var inBetween google maps geometry spherical interpolate nyc london 0 5 var marker new google maps Marker position inBetween map map This code will return a position right between NYC and London By using interpolate between NYC and London with the fraction 0 5 we get the position right in the middle of those Conclusion Calculating areas and distances on geo data can be tricky but with the help of the Geometry Library it s really simple I hope this article has shed some light on how you can use it in your own map solution More resources To read more about this library check out the article Google Maps Javascript API V3 Geometry Library in the offical documentation You ll also find a description of all the functions in the API documentation Tutorials Geo Google Maps Google Maps API 3 Javascript Previous post Action Confirm Design Pattern Next post 4 Books on UX that I ve read recently 23 Comments rca April 8 2011 at 3 16 pm Hi You have made one mistake var endPoint google maps geometry spherical computeOffset nyc heading distance should be var endPoint google maps geometry spherical computeOffset nyc distance heading Reply Gabriel Svennerberg Post author April 8 2011 at 11 16 pm rca Good catch Thanks for letting me know I ve updated the article so that it s now correct Reply Selvi April 26 2011 at 5 17 pm question I find that 3 2 api does not have the geomentry function google maps geometry spherical computeHeading Looks like it has 4 values you can take 0 90 180 270 Is there any other way to compute heading in 3 2 Reply Gabriel Svennerberg Post author April 28 2011 at 12 10 pm Selvi There s no other way of computing headings in v 3 2 that I m aware of But you could of course do the calculations yourself Reply xiaofanku July 14 2011 at 4 17 am i want used georss in google map api v3 but not can custom address icon you have solution Reply Tom July

    Original URL path: http://www.svennerberg.com/2011/04/calculating-distances-and-areas-in-google-maps-api-3/?replytocom=812 (2016-04-28)
    Open archived version from archive


  • Calculating Distances and Areas in Google Maps API 3 | In usability we trust
    40 715 74 002 var distance 5576673 var heading 51 2145 var endPoint google maps geometry spherical computeOffset nyc distance heading var marker new google maps Marker position endPoint map map In this case endPoint will be the location of London which is LatLng 51 506 0 118 it differs slightly because I ve rounded the numbers With the computeOffset function we can get the end location if we know the starting point the heading and the distance Calculate a point in between Another useful function is interpolate which determines a point between two locations based on a fraction between 0 and 1 The fraction represents how far between two locations a point is So for example 0 5 is a point right in the middle between the start and end location var nyc new google maps LatLng 40 715 74 002 var london new google maps LatLng 51 506 0 119 var inBetween google maps geometry spherical interpolate nyc london 0 5 var marker new google maps Marker position inBetween map map This code will return a position right between NYC and London By using interpolate between NYC and London with the fraction 0 5 we get the position right in the middle of those Conclusion Calculating areas and distances on geo data can be tricky but with the help of the Geometry Library it s really simple I hope this article has shed some light on how you can use it in your own map solution More resources To read more about this library check out the article Google Maps Javascript API V3 Geometry Library in the offical documentation You ll also find a description of all the functions in the API documentation Tutorials Geo Google Maps Google Maps API 3 Javascript Previous post Action Confirm Design Pattern Next post 4 Books on UX that I ve read recently 23 Comments rca April 8 2011 at 3 16 pm Hi You have made one mistake var endPoint google maps geometry spherical computeOffset nyc heading distance should be var endPoint google maps geometry spherical computeOffset nyc distance heading Reply Gabriel Svennerberg Post author April 8 2011 at 11 16 pm rca Good catch Thanks for letting me know I ve updated the article so that it s now correct Reply Selvi April 26 2011 at 5 17 pm question I find that 3 2 api does not have the geomentry function google maps geometry spherical computeHeading Looks like it has 4 values you can take 0 90 180 270 Is there any other way to compute heading in 3 2 Reply Gabriel Svennerberg Post author April 28 2011 at 12 10 pm Selvi There s no other way of computing headings in v 3 2 that I m aware of But you could of course do the calculations yourself Reply xiaofanku July 14 2011 at 4 17 am i want used georss in google map api v3 but not can custom address icon you have solution Reply Tom July

    Original URL path: http://www.svennerberg.com/2011/04/calculating-distances-and-areas-in-google-maps-api-3/?replytocom=813 (2016-04-28)
    Open archived version from archive

  • Extending Google Maps API 3 with libraries | In usability we trust
    include a library in the API you need to reference it in the script tag where you include the main API This is done by adding an additional parameter in the URL called libraries This is how to include the Geometry Library script type text javascript src http maps google com maps api js libraries geometry sensor true or false script Note To add more than one library you add them separated with a comma Accessing the methods The methods of the library are accessed through the google maps libraryName namespace So for instance to encode the path of a polyline a feature of the Geometry Library you write this var encodedPath google maps geometry encoding encodePath myPath Summary Libraries are a powerful way of including more functionality into the Google Maps API If you have the need for additional geometry functionality or need to include ads in a map you can start benefiting from them right away For other needs I m sure that new libraries will gradually be added as the API evolves Resources To read more about how to use the Google Maps API 3 Libraries check out these resources Libraries in the V3 Maps API Geometry Library Documentation Geometry Library API documentation AdSense Library Documentation AdSense Library API documentation My Google Maps book If you found this article useful you might be interested in my book Beginning Google Maps API 3 It covers everything you need to know to create awesome maps on your web sites Buy it on Amazon com Articles Google Maps Google Maps API 3 Previous post Dancing markers Next post 45 imagery view in Google Maps 5 Comments Tom Skinner March 9 2011 at 12 49 pm Hej good to see you re back in the blogging So can we start developing

    Original URL path: http://www.svennerberg.com/2011/03/extending-google-maps-api-3-with-libraries/?replytocom=806 (2016-04-28)
    Open archived version from archive

  • Extending Google Maps API 3 with libraries | In usability we trust
    include a library in the API you need to reference it in the script tag where you include the main API This is done by adding an additional parameter in the URL called libraries This is how to include the Geometry Library script type text javascript src http maps google com maps api js libraries geometry sensor true or false script Note To add more than one library you add them separated with a comma Accessing the methods The methods of the library are accessed through the google maps libraryName namespace So for instance to encode the path of a polyline a feature of the Geometry Library you write this var encodedPath google maps geometry encoding encodePath myPath Summary Libraries are a powerful way of including more functionality into the Google Maps API If you have the need for additional geometry functionality or need to include ads in a map you can start benefiting from them right away For other needs I m sure that new libraries will gradually be added as the API evolves Resources To read more about how to use the Google Maps API 3 Libraries check out these resources Libraries in the V3 Maps API Geometry Library Documentation Geometry Library API documentation AdSense Library Documentation AdSense Library API documentation My Google Maps book If you found this article useful you might be interested in my book Beginning Google Maps API 3 It covers everything you need to know to create awesome maps on your web sites Buy it on Amazon com Articles Google Maps Google Maps API 3 Previous post Dancing markers Next post 45 imagery view in Google Maps 5 Comments Tom Skinner March 9 2011 at 12 49 pm Hej good to see you re back in the blogging So can we start developing

    Original URL path: http://www.svennerberg.com/2011/03/extending-google-maps-api-3-with-libraries/?replytocom=810 (2016-04-28)
    Open archived version from archive

  • Action-Confirm Design Pattern | In usability we trust
    You therefor need to provide a fall back solution in cases when JavaScript and or CSS aren t available Progressive enhancement One way to do this and how I implemented it is to let the default action of the delete button which in fact is a a element be to navigate to a confirmation page that has a form with a submit button It s important that the form is posted using the method POST and not GET As a fallback the delete action is confirmed by posting a form Note The reason you should never let a regular link or a GETrequest make a destructive action is that it makes the application very vulnerable Imagine for example a search spider following all delete links Uh oh Use undo instead Naturally one can argue that a better design is to instead of making the user confirm an action let her easily recover from errors by providing some kind of undo However in some circumstances this isn t an option because of limitations in the underlying implementation In these cases the Action Confirm design pattern could be a viable solution Read more about using undo in the article No undo Redo Don t we want to interrupt the user One can also argue that it s a bad thing not to interrupt the user with a modal dialog After all doesn t we want the user to stop and evaluate whether the action was intended or not Research has showned that users often just click through these dialogs without giving them a second thought In these cases the dialog becomes useless and nothing more than an annoyance This design pattern doesn t solve that problem but it minimizes the intrusiveness of it Conclusion I created this design pattern to solve a common problem Confirmation of an action What do you think Is it better than a regular confirmation dialog Could it be further enhanced Are there any other problems with it Articles Design patterns Interaction design UX Previous post Designing with the mind in mind Next post Calculating Distances and Areas in Google Maps API 3 7 Comments Octavio April 1 2011 at 5 53 pm Very interesting approach until now I just imagined to display a javascript alert before deleting on a web page but in the iphone it doesn t have that option I think I will use that idea in my job Reply Eric April 4 2011 at 6 37 am Great idea The only problem I see is the confusion for the user if they want to go back Is hitting an escape button or clicking outside going to be obvious to the user Reply Gabriel Svennerberg Post author April 4 2011 at 12 58 pm Eric Good point On the other hand in the words of Alan Cooper All idioms must be learned good idioms need to be learned only once About Face 3 Cooper Reimann Cronin 2007 Maybe this is one of those idioms From

    Original URL path: http://www.svennerberg.com/2011/04/action-confirm-design-pattern/?replytocom=822 (2016-04-28)
    Open archived version from archive

  • Action-Confirm Design Pattern | In usability we trust
    therefor need to provide a fall back solution in cases when JavaScript and or CSS aren t available Progressive enhancement One way to do this and how I implemented it is to let the default action of the delete button which in fact is a a element be to navigate to a confirmation page that has a form with a submit button It s important that the form is posted using the method POST and not GET As a fallback the delete action is confirmed by posting a form Note The reason you should never let a regular link or a GETrequest make a destructive action is that it makes the application very vulnerable Imagine for example a search spider following all delete links Uh oh Use undo instead Naturally one can argue that a better design is to instead of making the user confirm an action let her easily recover from errors by providing some kind of undo However in some circumstances this isn t an option because of limitations in the underlying implementation In these cases the Action Confirm design pattern could be a viable solution Read more about using undo in the article No undo Redo Don t we want to interrupt the user One can also argue that it s a bad thing not to interrupt the user with a modal dialog After all doesn t we want the user to stop and evaluate whether the action was intended or not Research has showned that users often just click through these dialogs without giving them a second thought In these cases the dialog becomes useless and nothing more than an annoyance This design pattern doesn t solve that problem but it minimizes the intrusiveness of it Conclusion I created this design pattern to solve a common problem Confirmation of an action What do you think Is it better than a regular confirmation dialog Could it be further enhanced Are there any other problems with it Articles Design patterns Interaction design UX Previous post Designing with the mind in mind Next post Calculating Distances and Areas in Google Maps API 3 7 Comments Octavio April 1 2011 at 5 53 pm Very interesting approach until now I just imagined to display a javascript alert before deleting on a web page but in the iphone it doesn t have that option I think I will use that idea in my job Reply Eric April 4 2011 at 6 37 am Great idea The only problem I see is the confusion for the user if they want to go back Is hitting an escape button or clicking outside going to be obvious to the user Reply Gabriel Svennerberg Post author April 4 2011 at 12 58 pm Eric Good point On the other hand in the words of Alan Cooper All idioms must be learned good idioms need to be learned only once About Face 3 Cooper Reimann Cronin 2007 Maybe this is one of those idioms From observing

    Original URL path: http://www.svennerberg.com/2011/04/action-confirm-design-pattern/?replytocom=824 (2016-04-28)
    Open archived version from archive

  • Design Principles | In usability we trust
    Svennerberg 0 Comments Designing with the mind in mind is an excellent book that reveals the facts and neurological research behind common design principles In this review I will tell you why you should read this book Continue reading About me My name is Gabriel Svennerberg and I m a UX Designer Frontend Specialist and Author from Sweden More about me I m located in Växjö Sweden but am helping

    Original URL path: http://www.svennerberg.com/tag/design-principles/ (2016-04-28)
    Open archived version from archive

  • User Interface Design | In usability we trust
    Svennerberg 0 Comments Designing with the mind in mind is an excellent book that reveals the facts and neurological research behind common design principles In this review I will tell you why you should read this book Continue reading About me My name is Gabriel Svennerberg and I m a UX Designer Frontend Specialist and Author from Sweden More about me I m located in Växjö Sweden but am helping

    Original URL path: http://www.svennerberg.com/tag/user-interface-design/ (2016-04-28)
    Open archived version from archive



  •