Skip to main content
Share Your Experience: Take the 2024 Developer Survey
6 votes

Generate points for smooth movement between two given points

Dividor dividor is ill-defined. It acts as a factor for quantization: xi = xi / divider; But also as threshold for yielding ...
dfhwze's user avatar
  • 13.9k
5 votes

Generate points for smooth movement between two given points

The Tuple<T1, T2> type is a reference type requiring to create objects on the heap, what puts strain on the GC. Use a value type, i.e. a struct type. Use the ...
Olivier Jacot-Descombes's user avatar
4 votes
Accepted

Drawing multiple polygons in Google Maps in the same style

You have several options to reduce the code duplication here. Put the common values into variables, and replace all hardcoded values with those new variables. Create a prototype object of all the ...
janos's user avatar
  • 111k
4 votes

Display multiple polygons on Google Maps and toggle visibility of each polygon

If you want to use checkboxes to toggle polygons, you can set a user-defined properties when you creating a new polygon. For example: ...
Nguyễn Hùng Cường's user avatar
4 votes

Excel VBA to parse JSON out of Google Maps API

I'll clear the easy stuff first, using Rubberduck 2.0b code inspections: Language Opportunities Prefer vbNullString to ...
Mathieu Guindon's user avatar
4 votes
Accepted

Using JavaScript promises to display weather and location information

$.when(getPosition()) $.when is only used when listening to multiple promises. Since ...
Joseph's user avatar
  • 25.1k
4 votes
Accepted

Function to find user's region based on GPS coordinates

The callback supplied to geocode has a lot of code in it. This becomes difficult to test independently of testing the rest of ...
Dan's user avatar
  • 3,748
4 votes

Generate points for smooth movement between two given points

Make it an enumerator You can make the evaluation lazy and get rid of the intermediate list by changing the return type to IEnumerable<>. Use named tuples ...
t3chb0t's user avatar
  • 44.3k
3 votes

Find SuburbName from latlong or location

There are lots of nice things in your code for a beginner, congratulations. Configuration file Right now, you obfuscated your API key so that we don't have it, that's logical. But it shouldn't be ...
IEatBagels's user avatar
  • 12.4k
3 votes

Placing many pins on a Google Map

This is taking so long because Google is geocoding each of your locations one by one. Geocoding takes a lot of time as the world is a very big place and you have a lot of locations. You can save some ...
I wrestled a bear once.'s user avatar
2 votes

Google maps API code

...
Joseph's user avatar
  • 25.1k
2 votes
Accepted

Plotting JSON locations using Google Road API with Javascript Promise chaining

Divide processing in simple functions, then chain them in linear fashion. Use literal .property or ['property'] consistently, ...
woxxom's user avatar
  • 1,952
2 votes
Accepted

Displaying multiple Google Maps markers on a Visualforce page

Sure, there are many things you can clean up just in your javascript. Always develop in strict mode. Always use Immediately Invoked Function Executions. You might not need jQuery If you decide you do ...
Adrian Larson's user avatar
2 votes
Accepted

AsyncTask for subscribing to current location

Note: the following refers to native Android development, I am not familiar with xamarin. About the approach It depends on what your aim is. The downside of using AsyncTask is that it's tied to the ...
AgentKnopf's user avatar
2 votes

Retrieving location coordinates from SQL database and plotting on a map android Gmaps

(not complete, but I'd start with these) Your variable convention is inscrutable. Why is mMap private? Why are the next three package-private? Why does ...
mdd-sbo's user avatar
  • 457
2 votes

Get JSON script code with pushing to heatmap

Scope of Variables Unless imei is used outside of the code in your post (which would be grounds for making it off-topic), then you should declare it as local to ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes

Find SuburbName from latlong or location

I would reccomend using string.IsNullOrWhitespace(..) instead of string.IsNullOrEmpty(..), but this depends on how you call ...
Fabian S.'s user avatar
  • 161
2 votes

Function to find user's region based on GPS coordinates

I agree with the great feedback in Dan's answer. I like using functional programming wherever possible (and recommend these exercises for anyone who wants to work with FP in JS more), though one ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes
Accepted

Places memoized service via Google Maps

The code looks like typical code that uses the Google Maps API. Nice work serializing the markers in localstorage. I did notice that there doesn't appear to be any mechanism to prevent the user from ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes
Accepted

Turning on/off setInterval locating - using React.js

Typo? I think you meant to set isDragged to false when dragging finishes: ...
CertainPerformance's user avatar
1 vote

Displaying multiple objects on map and calculating distances using google api

My observations: Use let instead of var. You are already using let in some places, but a ...
givanse's user avatar
  • 121
1 vote
Accepted

Hover on list items to change map marker styling

While I wouldn't say your code is inefficiently styled, you can definitely improve the performance of your components. React performs in a tree format, when a component updates, all their children ...
Quill's user avatar
  • 11.9k
1 vote
Accepted

Bottlenecks in asynchronous JavaScript code for Google Map

Storing coordinates in Google Apps Script, instead of fetching each time on client-side As was alluded to in your comment, yes the fetching of GPS coordinates could be handled on the server side. ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
1 vote

Get JSON script code with pushing to heatmap

There are a lot of things that can be improved, especially when working with inputs, then use keyup or blur so you don't have to ...
Pavlo's user avatar
  • 418
1 vote

Google Maps API with Jackson Parser

Because this is an old post just some quick remarks: The method is doing too many different things. At the very least the HTTP request and the JSON parsing should be separated. There is no need to ...
RoToRa's user avatar
  • 11k
1 vote

Google Maps API with Jackson Parser

Never swallow exceptions silently like this: } catch (ClientProtocolException e) { } catch (IOException e) { } You'll have a nasty time debugging hidden ...
200_success's user avatar
1 vote

Google Maps Directions API

private long[][] times = null; So this starts as unset. In the method fetchMatrixResult, you initialize it. You set ...
mdfst13's user avatar
  • 21.6k
1 vote

Python application to create Google Map image

I agree with BKSpurgeon's duck type criticism of create_symbolizer(). (Also, typo in msg, with possible copy-n-paste error into <...
J_H's user avatar
  • 27.6k
1 vote

Factory hierarchy for creating GoogleMap and its elements

I think your conception of the factory pattern is a little off. Throughout your classes, you seem to want to deal with concrete factory objects, which doesn't seem to make sense. Typically, a ...
Mike Brant's user avatar
  • 9,608

Only top scored, non community-wiki answers of a minimum length are eligible